I use on a connected socket on my server something like this to send data to the client:
IAsyncResult asyncRes = connectionSocket.BeginSend(data, 0, length, SocketFlags.None,
out error, new AsyncCallback(SendDataDone), signalWhenDataSent);
As it seems, when there is a slow internet connection between the server and the client I receive an exception description like this: NoBufferSpaceAvailable
What exactly does this error mean ? The internal OS buffer for the socket connectionSocket is full ? What are the means to make it work. As a context where this appears is in a http proxy server. This might indicate, I suppose, that the rate at which data is coming from the origin server is higher than the rate my server can handle with the proxy client. How would you deal with it ?
I am using tcp.
The way to fix this problem is to correlate the way one reads from one socket to the speed one writes to the other socket because if you do no buffering you cannot write to a socket at a higher speed than the client connected at that end can read.
You one uses synchronous sockets the problem does not appear because they block as long as the operation is still pending but this is not the case with async calls.