This blog shows how to send and receive data via TCP/IP using Socket in .NET Framework. There are methods Socket.Send and Socket.Receive.
Send method sends data from your buffer to a connected Socket. When you call the Send method it returns number of bytes which were sent. But it doesn’t mean that the bytes were already received by the other side, it only means that the data were stored in a socket buffer and the socket will be trying to send them. If the socket buffer is full a WouldBlock error occurs. You should wait for a while a try to send the data again. (more…)