Re: multithreaded tcp/ip monitoring application

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



On Thu, 12 Jul 2007 09:16:03 -0700, Punit Kaur <PunitKaur@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

[...]
Now the problem is... the sending of the data is so fast that the receiving
side is not able to keep up with it. From the server side I am sending data
in a comma separated fashion. And each data packet I send has constant length
61 bytes. If If do not add any delay in send, the receive at the client side
receives 2-3 data packets and then is not able to parse the received data
properly.

As Michael's response indicates, you need to delimit your data yourself.

I suspect that you are not dealing with a bandwidth problem, but rather a logic error in your own code. Just because the sender sends in 61-byte increments, that doesn't mean that's how the data is sent out the network adapter, nor does it mean that's how the data is received on the receiving side. That's why you receive "2-3 data packets"...when several 61-byte chunks are sent in quick succession they are automatically coalesced by TCP.

When you receive these, you need to break them apart yourself.

Pete
.