TCP packet size?

Nigel Head nhead at houbits.com
Wed Jun 14 08:23:07 EDT 2000


I don't think this is reliably possible .. in Python or anything else.

My belief is that TCP is a "stream" prototcol - ie it just shovels a 
sequence of octets from here to there, grouped in some arbitrary way. Any 
concept of a "record" gets lost. Just 'cos you write the data in one lump 
gets you no control whatsoever over the pieces it gets received in. The 
only thing you know is that the octets will arrive, eventually, in the 
order you sent them in (or the link will drop).

But-then-if-beliefs-were-truths-we'd-all-be-Timbots'ly yours

Nigel.


chris at rpgarchive.com (chris) wrote in <3948AC51.98E5EAEC at rpgarchive.com>:
...
> A problem arises when I send a large message
>(3000-4000 bytes). Despite the fact that I give a large buffer size to
>socket.read() method, I often receive that message dissembled.  Also,
>sometimes I'll find small messages combined in the same read() call.
>The messages just aren't reassembled the way I thought TCP worked.  I'm
>hoping to find a way to received one message at a time in its entirety,
>or determine the start and end of my messages.
...



More information about the Python-list mailing list