Skip to content

Commit

Permalink
CancelPendingRead for output pipe
Browse files Browse the repository at this point in the history
  • Loading branch information
kerryjiang committed Jan 1, 2025
1 parent ac1a78c commit 7305207
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/SuperSocket.Connection/PipeConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,5 +205,10 @@ protected override bool IsIgnorableException(Exception e)

return false;
}

protected override void CancelOutputPendingRead()
{
this.Output.Reader.CancelPendingRead();
}
}
}
5 changes: 5 additions & 0 deletions src/SuperSocket.Connection/PipeConnectionBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ protected async Task CancelAsync()

_cts.Cancel();
await CompleteWriterAsync(OutputWriter, _isDetaching).ConfigureAwait(false);
CancelOutputPendingRead();
}

protected virtual bool IsIgnorableException(Exception e)
Expand Down Expand Up @@ -438,5 +439,9 @@ protected virtual async ValueTask CompleteWriterAsync(PipeWriter writer, bool is
{
await writer.CompleteAsync().ConfigureAwait(false);
}

protected virtual void CancelOutputPendingRead()
{
}
}
}

0 comments on commit 7305207

Please sign in to comment.