From cf1d57b79b0b60bee28152dc92746edea65dfe60 Mon Sep 17 00:00:00 2001 From: Nuclearist Date: Sun, 4 Feb 2024 19:01:09 +0300 Subject: [PATCH] Fixed a hang when using CMClient.Disconnect() --- TEKSteamClient.csproj | 2 +- src/CM/WebSocketConnection.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/TEKSteamClient.csproj b/TEKSteamClient.csproj index 320a483..128956b 100644 --- a/TEKSteamClient.csproj +++ b/TEKSteamClient.csproj @@ -1,7 +1,7 @@ net8.0 - 1.4.0 + 1.4.1 $(BaseVersion) $(BaseVersion)-alpha.$(GITHUB_RUN_NUMBER) Nuclearist diff --git a/src/CM/WebSocketConnection.cs b/src/CM/WebSocketConnection.cs index 2d07b8a..c945055 100644 --- a/src/CM/WebSocketConnection.cs +++ b/src/CM/WebSocketConnection.cs @@ -300,7 +300,7 @@ public void Disconnect() _socket.CloseOutputAsync(WebSocketCloseStatus.EndpointUnavailable, null, default); } } - else if (_socket?.State is WebSocketState.Open) + if (_socket?.State is WebSocketState.Open) _socket.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, null, _cts!.Token); if (Thread.CurrentThread != _thread) _thread?.Join();