mirror of
https://github.com/JKorf/CryptoExchange.Net.git
synced 2026-08-22 13:52:54 +00:00
Fixed duplicate subscription check with updated deserialization
This commit is contained in:
@@ -877,8 +877,16 @@ namespace CryptoExchange.Net.Sockets.Default
|
|||||||
subscription.CancellationTokenRegistration.Value.Dispose();
|
subscription.CancellationTokenRegistration.Value.Dispose();
|
||||||
|
|
||||||
bool anyDuplicateSubscription;
|
bool anyDuplicateSubscription;
|
||||||
lock (_listenersLock)
|
if (ApiClient.ClientOptions.UseUpdatedDeserialization)
|
||||||
anyDuplicateSubscription = _listeners.OfType<Subscription>().Any(x => x != subscription && x.MessageMatcher.HandlerLinks.All(l => subscription.MessageMatcher.ContainsCheck(l)));
|
{
|
||||||
|
lock (_listenersLock)
|
||||||
|
anyDuplicateSubscription = _listeners.OfType<Subscription>().Any(x => x != subscription && x.MessageRouter.Routes.All(l => subscription.MessageRouter.ContainsCheck(l)));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lock (_listenersLock)
|
||||||
|
anyDuplicateSubscription = _listeners.OfType<Subscription>().Any(x => x != subscription && x.MessageMatcher.HandlerLinks.All(l => subscription.MessageMatcher.ContainsCheck(l)));
|
||||||
|
}
|
||||||
|
|
||||||
bool shouldCloseConnection;
|
bool shouldCloseConnection;
|
||||||
lock (_listenersLock)
|
lock (_listenersLock)
|
||||||
|
|||||||
Reference in New Issue
Block a user