Re: Dynamic Packet Size


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

Posted by Phil Frisbie on May 31, 2006 at 12:09:55:

In Reply to: Re: Dynamic Packet Size posted by Adam on May 30, 2006 at 21:59:44:

: : if i have a struct like so
: :
: : struct PACKET
: : {
: : unsigned char command;
: : unsigned short size;
: : char* message;
: : };
: :
: : how would i go about sending and recieving it? assuming "unsigned short size" is set to the size of the packet, or message length? or does the size of the packet need to be static?
:
: im gunna change my question a little.
:
: how would i recieve this packet if i dont know the size before hand?

Since this is your application, you know the MAX packet size, right? Just allocate a buffer the max size and keep using that.

Phil



Follow Ups:


Post a Followup

Name:
E-Mail:

Subject:

Comments:



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