RE: [GD-General] RE: Gamedevlists-general digest, Vol 1 #79 - 3 msgs
Brought to you by:
vexxed72
From: Jaek S. <smi...@cs...> - 2002-07-02 06:36:05
|
> Thats the whole point of the article, to my eye. Establishing a protocol > such that the sender includes enough information that the reciever knows > where the packet boundaries are, once their udp packets have been > converted into a meaningless byte stream (which is what the buffering > inside recv() does for you) Datagrams are never really converted to a 'meaningless byte stream'. Here's part of the man-page on recv(): "All three routines return the length of the message on successful completion. If a message is too long to fit in the supplied buffer, excess bytes may be discarded depending on the type of socket the message is received from..." Thus, for a datagram (UDP), you would generally lose the excess amount. Generally, you want to pass a buffer the size of your maximum sized message. (Note: 64K should be the max possible size for UDP - if I recall correctly). --Jaek |