I am having problems with the dataArrival event on the server side of a winsock connection.

I have a loop on the client side, sending an byte array of 4096 bytes at a fairly constant rate.

My problem is that after a random number of calls to the dataArrival event by the server, it is not receiving all of the data. For example after 10 loops on the client side (sending data), the dataArrival will be called after only receiving half of the data.

Anyone know about this problem?? Or when dataArrival is supposed to be called (ie. When the first bit of data arrives, all the data, half way...)??

I've been stuck on this bug for 3 days. I need help!!

Thanks!