Re: Broken TCP/IP packets
- From: "Ali" <abdulrazaq@xxxxxxxxx>
- Date: 11 Apr 2007 19:10:53 -0700
On Apr 11, 12:27 am, "MisterE" <v...@xxxxxxxxxxxxxxx> wrote:
So your reciveing end simply must be written so as it keeps on reading
from the TCP stream up until you have 20 bytes, and store excess bytes
it may have read for the next call. This can easily be implemented
with a ring buffer structure and as many calls to recv() as needed.
If you try to circumvent this, you are fighting against TCP and
potential oddities/requierements of the unterlaying network along the
comunication path.
No converter will break up a 20 byte burst into multiple packets. If this is
happeneing its the worst converter I have ever seen. If the packets were
2,000 bytes then maybe, but I have never seen a converter send while data is
still being recieved. I suspect the user has set a setting wrong on the
device to only allow 10 byte buffer or something. We have 300byte packets
and have NEVER seen on brocken out of hundreds of thousands (I programmed it
to log these and it has never happened).
Snip from MisterE:
I suspect the user has set a setting wrong on the device to only allow 10 byte buffer or something.
10 bytes was just an example as some times i do receive 40 (consisting
on 2 complete packets) bytes too, the point was packet breaking. I
guess that its because of TCP/IP behaviour so there is nothing we can
do unless we switch to some other protocol. Anyway, i've fixed the
issue while making a buffer on converter say for 128 or 256 bytes and
it works fine though technically its not that much real time now. But
i think it should be Ok as TCP/IP is never meant for real time anyway.
thanks for input.
ali
.
- References:
- Broken TCP/IP packets
- From: Ali
- Re: Broken TCP/IP packets
- From: Markus Zingg
- Re: Broken TCP/IP packets
- From: MisterE
- Broken TCP/IP packets
- Prev by Date: Re: OFF TOPIC: Job hunting dress code
- Next by Date: Re: Broken TCP/IP packets
- Previous by thread: Re: Broken TCP/IP packets
- Next by thread: Re: Broken TCP/IP packets
- Index(es):
Relevant Pages
|