public override int Read(byte[] buffer, int offset, int count) { CheckConnectionAuthenticated(); return(ssl_stream.Read(buffer, offset, count)); //return EndRead (BeginRead (buffer, offset, count, null, null)); }
public override int Read(byte[] buffer, int offset, int length) { try { int read = _sslStream.Read(buffer, offset, length); if (read != length) { throw new ArgumentException("Could not read enough bytes from ssl stream, maybe we got disconnected?"); } return(read); } catch (Exception e) { _logger.Fatal(e); _logger.Fatal("Closing connection"); RaiseDisconnectedEvent(); throw new DisconnectedException(); } }