From e45fa235e083314cb69f508181a4ea4e60baf815 Mon Sep 17 00:00:00 2001 From: nils2525 Date: Tue, 3 Nov 2026 04:39:50 -0800 Subject: [PATCH] Fixed socket cleanup after connection failures (#301) --- CryptoExchange.Net/Clients/SocketApiClient.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CryptoExchange.Net/Clients/SocketApiClient.cs b/CryptoExchange.Net/Clients/SocketApiClient.cs index 493cf010..de972eba 100644 --- a/CryptoExchange.Net/Clients/SocketApiClient.cs +++ b/CryptoExchange.Net/Clients/SocketApiClient.cs @@ -899,6 +899,8 @@ namespace CryptoExchange.Net.Clients return connectResult; } + // Remove the connection and stop any reconnect processing before disposing it. + await socketConnection.CloseAsync().ConfigureAwait(false); socketConnection.Dispose(); return connectResult; }