Posted by Adam on June 20, 2006 at 23:35:34:
In Reply to: Re: Dynamic Packet Size posted by Phil Frisbie, Jr. on June 05, 2006 at 12:26:14:
: : : 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
ok im trying to use TCP packets, and i can get everything across except the message which is a pointer in a struct.
struct PACKET
{
unsigned char command;
unsigned char length; //this is the length of the message
char* message; //this is what isnt being sent properly..
}