public override void Abort(ConnectionAbortedException abortReason) { // Don't call _stream.Shutdown and _stream.Abort at the same time. lock (_shutdownLock) { _stream.AbortRead(_context.Options.AbortErrorCode); _stream.AbortWrite(_context.Options.AbortErrorCode); } // Cancel ProcessSends loop after calling shutdown to ensure the correct _shutdownReason gets set. Output.CancelPendingRead(); }
public override void Abort(ConnectionAbortedException abortReason) { // This abort is called twice, make sure that doesn't happen. // Don't call _stream.Shutdown and _stream.Abort at the same time. if (_aborted) { return; } _aborted = true; _log.StreamAbort(ConnectionId, abortReason); lock (_shutdownLock) { _stream.AbortRead(Error); _stream.AbortWrite(Error); } // Cancel ProcessSends loop after calling shutdown to ensure the correct _shutdownReason gets set. Output.CancelPendingRead(); }