The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: ecube on July 23, 2009, 05:16:28 AM

Title: send
Post by: ecube on July 23, 2009, 05:16:28 AM
in a client server app i'm workin on, something weird happened, i made 2 send calls from the client, back to back, then I had a MessageBox show on recv'd data for the server, only the server showed the data from both send calls all at once...I was under the impression 1 recv would recv data from 1 send call, not multiple?
Title: Re: send
Post by: Tedd on July 23, 2009, 01:25:55 PM
That's just how it works.
recv just gets the next chunk of data waiting to be read, even if that's multiple (or partial) 'messages' - however much has been queued up to that point (and will fit in your recv buffer.)
If you want to delimit, you need to do that yourself - buffer the recv'd data so you can parse out a full message at a time ("Since you could receive o", "nly part of a message. And then another.")