Hello, I have a little client-server application using tcp sockets. On both sides I use a buffer size of 4096 and I run all my tests with the client and server on the same machine, using address 127.0.0.1. Everything is going well except that now I suddenly need to send much larger messages. A message could now easily be 12MB in size. Now, what happens is that the transmission is incomplete : on the receiving end, I only get a chunk of the message instead of the whole thing.
I thought about simply increasing the buffer sizes on both ends to something larger than my maximum message size, but I'm not sure that's a reliable method, even if it works, and I'm not sure it'll work (if it's supported by TCP, if I won't run out of memory, etc.).
I also thought about splitting the message and actually my sending code automatically does that already, it will keep sending until all the data has been sent. However, on the receiving end, how do I know where a message ends, do I need to implement a protocol for that? I thought TCP already took care of that.
Meta (Facebook) tends to make horribly designed apps, which not sure if its deliberate or just plain poor design, maybe due to incompetence. For a huge internationally and well known company, this is baffling, they are getting bad PR but I guess they are tok big and super popular and seemingly can get away from any gov thus they are getting away with these blunders.
Example their Facebook Stories, when mobile OS uses gestures for years to go back to previous menu, it just tends to swipe to previous or next stories instead of exiting the UI. I have to make sure I swipe from the very edge. This really bad UX but Facebook doesnt car about the bad UI practices. Is this deliberate, malice? Idk, maybe for force engagement, or just somebody never tested their products well about the issue, maybe they think user should know better and just arrogant to thing we are using it wrong?
This is insane for a tech focused site tbh. I cant understand anyone who would want this let alone anyone interested in tech or pc's.
I understand the want to push stack deals but this is a terrible deal. I have bought a few deals through neowins stack before, they were good deals but this....
Its really apparent that these features and how they treat new Outlook now to be only web based to call these features "Offline mode". Like before we just gain features without them being called offline mode feature, but now here it is.
It feels like if these codes bugged, we might left with app that is just useless liece kf codes when PC isnt connected to internet, especially laptops and tablets/convertibles.
Recent Achievements
Case_f went up a rank Explorer
Jamie Smith earned a badge Conversation Starter
NeoToad777 earned a badge First Post
JoeV earned a badge Week One Done
VAT Services in UAE earned a badge One Month Later
Question
Andre S. Veteran
Hello, I have a little client-server application using tcp sockets. On both sides I use a buffer size of 4096 and I run all my tests with the client and server on the same machine, using address 127.0.0.1. Everything is going well except that now I suddenly need to send much larger messages. A message could now easily be 12MB in size. Now, what happens is that the transmission is incomplete : on the receiving end, I only get a chunk of the message instead of the whole thing.
I thought about simply increasing the buffer sizes on both ends to something larger than my maximum message size, but I'm not sure that's a reliable method, even if it works, and I'm not sure it'll work (if it's supported by TCP, if I won't run out of memory, etc.).
I also thought about splitting the message and actually my sending code automatically does that already, it will keep sending until all the data has been sent. However, on the receiving end, how do I know where a message ends, do I need to implement a protocol for that? I thought TCP already took care of that.
Anyway I'm a bit lost there, thanks for any tips.
Link to comment
https://www.neowin.net/forum/topic/809920-sending-large-message-over-tcp/Share on other sites
9 answers to this question
Recommended Posts