Skip to content

Commit c023059

Browse files
committed
Fixed ODE caused by SetNoResult
1 parent 1a08b13 commit c023059

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/cluster/DotNext.Net.Cluster/Net/Multiplexing/MultiplexedListener.Dispatcher.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff 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
{

0 commit comments

Comments
 (0)