1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-08-11 16:32:57 +00:00

Close socket when connecting and authentication fails

This commit is contained in:
JKorf
2024-06-23 14:55:20 +02:00
parent 09ed7d1436
commit e927bc3d20
@@ -383,7 +383,11 @@ namespace CryptoExchange.Net.Clients
if (!authenticated || socket.Authenticated)
return new CallResult(null);
return await AuthenticateSocketAsync(socket).ConfigureAwait(false);
var result = await AuthenticateSocketAsync(socket).ConfigureAwait(false);
if (!result)
await socket.CloseAsync().ConfigureAwait(false);
return result;
}
/// <summary>