Skip to content

Commit 86263bc

Browse files
authored
Contents in _packagePipe are not read after the socket is disconnected. (#657)
1 parent 305b19a commit 86263bc

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/SuperSocket.Channel/PipeChannel.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public async override IAsyncEnumerable<TPackageInfo> RunAsync()
8484
if (_readsTask == null || _sendsTask == null)
8585
throw new Exception("The channel has not been started yet.");
8686

87-
while (true)
87+
while (!_cts.IsCancellationRequested)
8888
{
8989
var package = await _packagePipe.ReadAsync().ConfigureAwait(false);
9090

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

9696
yield return package;
9797
}
98+
99+
//How do empty a pipe?
98100
}
99101

100102
private async ValueTask HandleClosing()

0 commit comments

Comments
 (0)