Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

NCBC-197: Throw meaningful exception when 0 bytes received on socket

  • Loading branch information...
commit aa77334b37978089521a12c75cdc71efa795d14b 1 parent 23ebf99
John Zablocki authored January 08, 2013
3  Enyim.Caching/Memcached/BasicNetworkStream.cs
@@ -89,7 +89,8 @@ public override int Read(byte[] buffer, int offset, int count)
89 89
 				if (errorCode == SocketError.Success && retval > 0)
90 90
 					return retval;
91 91
 
92  
-				throw new System.IO.IOException(String.Format("Failed to read from the socket '{0}'. Error: {1}", this.socket.RemoteEndPoint, errorCode == SocketError.Success ? "?" : errorCode.ToString()));
  92
+				string errorMessage = errorCode == SocketError.Success ? "SocketError value was Success, but 0 bytes were received" : errorCode.ToString();
  93
+				throw new System.IO.IOException(String.Format("Failed to read from the socket '{0}'. Error: {1}", this.socket.RemoteEndPoint, errorMessage));
93 94
 			}
94 95
 
95 96
 			public override long Seek(long offset, SeekOrigin origin)

0 notes on commit aa77334

Please sign in to comment.
Something went wrong with that request. Please try again.