Re: TCP question



In article <eOhre6mCHHA.472@xxxxxxxxxxxxxxxxxxxx>, tiredofit@xxxxxxxxxxx
says...
"fniles" <fniles@xxxxxxxxxx> wrote in message
news:uPBYv0mCHHA.5012@xxxxxxxxxxxxxxxxxxxx
I am using TCP control in VB6. I am sending a lot of messages every
milli seconds.
Sometimes (not very often) the messages received will be out of
order, and they are NOT received one after another. In between the
message, there are other messages.
Like the following example:

ABC,140425,140450,139800,LAST|
39850,,LAST| -->> incomplete and out of order, it should be after
the message below
ABC,140415,140440,139700,,LAST|
ABC,140430,140455,139815,,LAST|
ABC,140445,140470,139820,,LAST|
ABC,140425,140450,1 -->> incomplete and out of order, it should be
before the message above

Message "ABC,140425,140450,1" should appear before and be together
with "40125,,LAST| "
So, it should be "ABC,140425,140450,139850,,LAST|".

Is this how TCP works ?

No, TCP guarantees that the data is received in the order it is sent. Show
the code you have for receiving the packets

No, it does not guarantee the order; just that they will be received
intact. Consecutive packets can even take different routes from sender
to receiver, which can easily change the receipt order. If one is lost
or damaged en route, it will request a resend of that particular packet,
and that can change the order as well.

I think the only time you can expect the order to be correct is if there
are no routers between the source and the destination, and I'm not even
sure if it's guaranteed even then.

--
Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible).
.



Relevant Pages

  • Re: Determining if it is "safe" to send UDP packets
    ... for receiving Udp data. ... I'm receiving from a camera lines of data at 55 Hz. ... I had to build some test programs that sent & received packets. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: The best way to wait for something to happen
    ... Be careful of UDP connections. ... packets, and then reordering them once they have all arrived. ... What do you recommend that would allow applications running on a LAN to ... I am coding a form that will be sending and receiving TCP/IP ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Streaming Video across the IT
    ... for most users there won't be any satellite hops in Internet streaming. ... With Internet, packets are sent, not in a contimuous stream and not ... This is why on receiving the "packets" ... need to "sorted" and joined to give reliable video. ...
    (comp.sys.mac.apps)
  • Re: Winsock - how to insure packets are received?
    ... The number of packets sent is not guaranteed to ... The receiving end needs to be able to parse the incoming data and buffer ... If I iterate 1000 times from the client to the server on my local machine ...
    (microsoft.public.vb.general.discussion)
  • Re: sending very large packets over the network
    ... Unfortunately on the receiving end, the packets appear to be ... the remainder in a loop until all bytes are sent. ... the send command in C ...
    (comp.lang.python)

Loading