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; }