protected IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state) { if (UseTls && SocketHell.FakeAsyncReadWithDelegate) { _currentReadOperation = new MonoBeginReadDelegate(this.CurrentStream.Read); return(_currentReadOperation.BeginInvoke(buffer, offset, count, callback, state)); } else { return(this.CurrentStream.BeginRead(buffer, offset, count, callback, state)); } }
protected int EndRead(IAsyncResult asyncResult) { if (UseTls && SocketHell.FakeAsyncReadWithDelegate) { int result; try { result = _currentReadOperation.EndInvoke(asyncResult); } finally { _currentReadOperation = null; } return(result); } else { return(this.CurrentStream.EndRead(asyncResult)); } }
protected int EndRead(IAsyncResult asyncResult) { if (UseTls && SocketHell.FakeAsyncReadWithDelegate) { int result; try { result = _currentReadOperation.EndInvoke(asyncResult); } finally { _currentReadOperation = null; } return result; } else { return this.CurrentStream.EndRead(asyncResult); } }
protected IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state) { if (UseTls && SocketHell.FakeAsyncReadWithDelegate) { _currentReadOperation = new MonoBeginReadDelegate(this.CurrentStream.Read); return _currentReadOperation.BeginInvoke(buffer, offset, count, callback, state); } else { return this.CurrentStream.BeginRead(buffer, offset, count, callback, state); } }