On Mon, 10 Dec 2001, Ralph Krausse wrote:

> I have a client (palm) and a server (windows). My palm application does
> to NetLibSends in a row, one a ULong with a value of 5, the next
> NetLibSend, a string of 5 bytes with the 'hello' in it. I get the data
> on my server but it all comes in one buffer that my server is reading
> from the buffer. I can understand why this is happing but is there a way
> to change that? I would like get 1 receive per send. 

Come up with your own packeting scheme.  Prepend a ULong "size" header to
everything you send (if it's in a separate send call, no problem).  When
you see data available on the server side, read the ULong first to see how
big the next "packet" is, then allocate a buffer for (if needed) and read
that number of bytes. 

I've done a messaging protocol before with that exact scheme, and it
worked rather well.  There's just no predictable way to do that relying on
TCP/IP implementations.

----------------------------------------------------------------------
Brian Smith  //   [EMAIL PROTECTED]   //  http://www.arthurian.nu/
Software Developer  //  Gamer  //  Webmaster  //  System Administrator
Bumper sticker: If you can read this, I can hit my brakes and sue you.


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to