TCP message order?

I am developing a C ++ application server and client that use TCP. I have three messages on the server: A, B and C. They are sent sequentially: A → B → C. And the client replies confirm the messages: rA, rB, rC.

The client receives A, B and C so that A-> BC? Does the server get rA-> rB-> rC?

+4
source share
1 answer

TCP ensures that the order in which packets are received (over a single connection) matches the order in which they are sent. There is no such guarantee if you have several TCP connections, however - TCP only stores orders for packets within a given TCP connection.

See the Wikipedia article on TCP for more information .

One of the functions of TCP is to prevent the extraordinary delivery of data either by reassembling packets into a queue, or by forcing packets to be repeated out of order.

+7
source

All Articles