Fix for issue #84
This commit is contained in:
		@@ -671,14 +671,28 @@ namespace WebSocketSharp
 | 
				
			|||||||
        0,
 | 
					        0,
 | 
				
			||||||
        length,
 | 
					        length,
 | 
				
			||||||
        ar => {
 | 
					        ar => {
 | 
				
			||||||
 | 
					          byte[] bytes = null;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
          try {
 | 
					          try {
 | 
				
			||||||
            var len = stream.EndRead (ar);
 | 
					            var len = stream.EndRead (ar);
 | 
				
			||||||
            var bytes = len < 1
 | 
					            bytes = len < 1
 | 
				
			||||||
                        ? new byte[0]
 | 
					                    ? new byte[0]
 | 
				
			||||||
                        : len < length
 | 
					                    : len < length
 | 
				
			||||||
                          ? stream.readBytes (buff, len, length - len)
 | 
					                      ? stream.readBytes (buff, len, length - len)
 | 
				
			||||||
                          : buff;
 | 
					                      : buff;
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
 | 
					          catch (ObjectDisposedException) {
 | 
				
			||||||
 | 
					            // The Stream has been closed.
 | 
				
			||||||
 | 
					            return;
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
 | 
					          catch (Exception ex) {
 | 
				
			||||||
 | 
					            if (error != null)
 | 
				
			||||||
 | 
					              error (ex);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            return;
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					          try {
 | 
				
			||||||
            if (completed != null)
 | 
					            if (completed != null)
 | 
				
			||||||
              completed (bytes);
 | 
					              completed (bytes);
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user