From 491f56d78d4ffba4bf689d93e2f4e87b9d9219e6 Mon Sep 17 00:00:00 2001 From: Derrick Timmermans Date: Sun, 26 Sep 2021 13:46:21 +0200 Subject: [PATCH] Account for OperationCanceledException --- .../IO/GameplayEventBroadcaster.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Sentakki/IO/GameplayEventBroadcaster.cs b/osu.Game.Rulesets.Sentakki/IO/GameplayEventBroadcaster.cs index 50a76d89a..695ae5d5f 100644 --- a/osu.Game.Rulesets.Sentakki/IO/GameplayEventBroadcaster.cs +++ b/osu.Game.Rulesets.Sentakki/IO/GameplayEventBroadcaster.cs @@ -1,6 +1,7 @@ using System; using System.IO; using System.IO.Pipes; +using System.Net.Sockets; using System.Threading; using System.Threading.Tasks; @@ -34,7 +35,13 @@ private async void attemptConnection() isWaitingForClient = true; try { await pipeServer.WaitForConnectionAsync(cancellationToken).ConfigureAwait(false); } - catch (TaskCanceledException) { return; } + catch (Exception e) + { + // The operation was canceled. Gracefully shutdown; + if (e is TaskCanceledException || (e is SocketException se && se.SocketErrorCode == SocketError.OperationAborted)) + return; + throw; + } isWaitingForClient = false;