Re:What developers should know about TCP
by jfkebwjsbx on Saturday May 16, 2020 @10:34AM
(#23203684)
Those quotes don't claim messages are received in full, you are misinterpreting them.
[ Parent
| on HN ]
Of course, but they do indicate that "there is still more of the message to receive" is a well-defined concept (or at least "there is more data to receive" is), which is all my point requires.
(Edit: also, it would help if you said what the correct interpretation would be, since it has the phrase "messages were arriving in full in every read call".)
>but they do indicate that "there is still more of the message to receive"
Not at the TCP level they don't.
They just give you some bytes. It's up to you to decide whether you have the full message or not and if you want to try to read more. The TCP read functions just give you the data they have. There is no concept of one write at the sender end translating to a complete message at the other end. It's just a stream of bytes.
Re:What developers should know about TCP
by anonymoushn on Saturday May 16, 2020 @11:10PM
(#23209232)
That poster's coworker was implementing a message-oriented protocol and testing the client and server on the same machine. When running the software in this configuration, the coworker observed that each read returned abd entire message, even though this was not going to be true in other configurations where the client and server are different machines or the messages are larger.