1
0
mirror of https://github.com/JKorf/CryptoExchange.Net synced 2025-06-06 23:46:12 +00:00

Update UnsubscribeAll in socket client to also unsubscribe on a dedicated connection

This commit is contained in:
JKorf 2025-03-04 19:45:06 +01:00
parent ac295de9f6
commit 8def7f32af

View File

@ -671,8 +671,11 @@ namespace CryptoExchange.Net.Clients
var tasks = new List<Task>();
{
var socketList = socketConnections.Values;
foreach (var connection in socketList.Where(s => !s.DedicatedRequestConnection.IsDedicatedRequestConnection))
tasks.Add(connection.CloseAsync());
foreach (var connection in socketList)
{
foreach(var subscription in connection.Subscriptions.Where(x => x.UserSubscription))
tasks.Add(connection.CloseAsync(subscription));
}
}
await Task.WhenAll(tasks.ToArray()).ConfigureAwait(false);