TCP data not sent or received !

Started by
2 comments, last by RockySabre 16 years, 11 months ago
I am developing a c# network application using TCP sockets. I am using different threads (each thread with its own socket). I notice that when the number of threads increase, some sent data using Socket.Send(...) function is not received on the other side. I use socket.avaialable property to check if there is data to receive. should i use socket.poll(...). Any help will be appreciated, thnx. while(true) { if(socket.Avaialable > 0) { socket.Receive(bytes); break; } else { Thread.Sleep(n); } }
Advertisement
please i need some help, thnx.
It's likely it is received, however, it is probably being merged into another send call, so that once receive call receives data from more than one send call. The Forum FAQ talks more about this. TCP is a stream protocol, not a packet protocol.
enum Bool { True, False, FileNotFound };
thnx bro, 2 send calls were merged. the problem was solved.

This topic is closed to new replies.

Advertisement