Skip to content

Commit

Permalink
Contents in _packagePipe are not read after the socket is disconnecte…
Browse files Browse the repository at this point in the history
…d. (#657)
  • Loading branch information
wj8400684 authored Jun 1, 2023
1 parent 305b19a commit 86263bc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/SuperSocket.Channel/PipeChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public async override IAsyncEnumerable<TPackageInfo> RunAsync()
if (_readsTask == null || _sendsTask == null)
throw new Exception("The channel has not been started yet.");

while (true)
while (!_cts.IsCancellationRequested)
{
var package = await _packagePipe.ReadAsync().ConfigureAwait(false);

Expand All @@ -95,6 +95,8 @@ public async override IAsyncEnumerable<TPackageInfo> RunAsync()

yield return package;
}

//How do empty a pipe?
}

private async ValueTask HandleClosing()
Expand Down

0 comments on commit 86263bc

Please sign in to comment.