Skip to content

Commit 491f56d

Browse files
committed
Account for OperationCanceledException
1 parent 16b8115 commit 491f56d

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

osu.Game.Rulesets.Sentakki/IO/GameplayEventBroadcaster.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.IO;
33
using System.IO.Pipes;
4+
using System.Net.Sockets;
45
using System.Threading;
56
using System.Threading.Tasks;
67

@@ -34,7 +35,13 @@ private async void attemptConnection()
3435
isWaitingForClient = true;
3536

3637
try { await pipeServer.WaitForConnectionAsync(cancellationToken).ConfigureAwait(false); }
37-
catch (TaskCanceledException) { return; }
38+
catch (Exception e)
39+
{
40+
// The operation was canceled. Gracefully shutdown;
41+
if (e is TaskCanceledException || (e is SocketException se && se.SocketErrorCode == SocketError.OperationAborted))
42+
return;
43+
throw;
44+
}
3845

3946
isWaitingForClient = false;
4047

0 commit comments

Comments
 (0)