File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
src/cluster/DotNext.Net.Cluster/Net/Multiplexing Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -51,16 +51,15 @@ private async Task DispatchAsync(Socket socket)
5151 try
5252 {
5353 var receiveLoop = output . ProcessAsync ( socket ) ;
54-
5554 while ( true )
5655 {
57- // rethrow exception from the receiving loop
58- if ( receiveLoop . IsCompleted )
59- await receiveLoop . ConfigureAwait ( false ) ;
60-
6156 try
6257 {
63- await input . ProcessAsync ( receiveLoop . IsNotCompleted , socket ) . ConfigureAwait ( false ) ;
58+ // rethrow exception from the receiving loop
59+ await ( receiveLoop . IsCompleted
60+ ? receiveLoop
61+ : input . ProcessAsync ( receiveLoop . IsNotCompleted , socket ) )
62+ . ConfigureAwait ( false ) ;
6463 }
6564 catch ( OperationCanceledException e ) when ( e . CancellationToken == lifetimeToken )
6665 {
You can’t perform that action at this time.
0 commit comments