{
SocketError error;
int bytesReceived = EndReceive (result, out error);
- if (error != SocketError.Success)
+ if (error != SocketError.Success) {
+ if (error != SocketError.WouldBlock && error != SocketError.InProgress)
+ connected = false;
throw new SocketException ((int)error);
+ }
return bytesReceived;
}
{
SocketError error;
int bytesSent = EndSend (result, out error);
- if (error != SocketError.Success)
+ if (error != SocketError.Success) {
+ if (error != SocketError.WouldBlock && error != SocketError.InProgress)
+ connected = false;
throw new SocketException ((int)error);
+ }
return bytesSent;
}