[En-Nut-Discussion] Timing and Receiving Data Problem for TCPServer

Clemens Kirchgatterer c.kirchgatterer at amatic.com
Fri Feb 2 07:27:40 CET 2007


On Thu, 2007-02-01 at 16:37 +0100, Jose Vicente Sanchez Ortega wrote:

> Believe me. TCP ensures that packets are delivered on the same order
that
> they went sent.

maybe one thing that adds to the confusion is, like you correctly
pointed out, that TCP is a stream and not a packet oriented protocol to
begin with. so to clear this up: using tcp you can be sure, that you get
all your data, without corruption and in the right order. on the other
hand, you must check for message boundaries on the application level.
i.e. if you put first 3 bytes on the wire and then 5, you may get all 8
bytes in one read() on the receiver side, or 2 times 4 bytes or any
other combination that sums up to 8. :-)

best regards ...
clemens




More information about the En-Nut-Discussion mailing list