I'm finding if i send many messages in a row I need to use a sleep because som of my messages are being recv conncatinated.
Is there a way I can send and recv messages between client and server (using sockets) without having to use sleep.
Thanks
I'm finding if i send many messages in a row I need to use a sleep because som of my messages are being recv conncatinated.
Is there a way I can send and recv messages between client and server (using sockets) without having to use sleep.
Thanks
I really have no clue what I'm talking about, but from the little that I know, it sounds to me like you just need to flush the buffer. Let's say you send like 3 messages all in a row, and they all get stringed together, isn't that because they all got shoved in the buffer before the buffer was flushed? So every time you hit "send" or whatever it is that you do, make sure the buffer is flushed. And hey, feel free to flame me if I'm totally off.
"What are all you parallelograms doing here?" - Peter Griffin (to Joe and his wheelchair buddies)
That is just normal behavour. There is no guarantee how messages arrive at the server ( or client ). They could come all together or could even be split into more messages then you send. If you want to send and handle explicit messages then you have to implement some kind of handshake between server and client.
Kurt
ah thanks.