Re: Dynamic Packet Size


[ Follow Ups ] [ Post Followup ] [ Back To Message Board ]

Posted by Phil Frisbie, Jr. on June 05, 2006 at 12:26:14:

In Reply to: Re: Dynamic Packet Size posted by Adam on May 31, 2006 at 16:58:08:

: : Since this is your application, you know the MAX packet size, right? Just allocate a buffer the max size and keep using that.
:
: if there are two packets waiting to be recieved, and both are less than the max size will it try to put both into one when recieving?

UDP, TCP, or TCP packets? If UDP or TCP packets then the answer is NO, you will only get one packet for each call to nlRead().

But if TCP, then you have a problem because plain TCP is a stream protocol and there are no packets. In this case you must decode the packets yourself and if you end up with part of the next packet then you need to keep it until you can read the rest of it.

Phil


Follow Ups:


Post a Followup

Name:
E-Mail:

Subject:

Comments:



[ Follow Ups ] [ Post Followup ] [ Back To Message Board ]