1
0
mirror of https://github.com/JKorf/CryptoExchange.Net synced 2026-02-16 14:13:46 +00:00

Added check for subscribe queries with TimeoutBehavior.Success to complete when subscription has received update

This commit is contained in:
Jkorf 2026-02-10 14:31:42 +01:00
parent 65291b3195
commit 7c67a014f5

View File

@ -174,6 +174,14 @@ namespace CryptoExchange.Net.Sockets.Default
{ {
ConnectionInvocations++; ConnectionInvocations++;
TotalInvocations++; TotalInvocations++;
if (SubscriptionQuery != null && !SubscriptionQuery.Completed && SubscriptionQuery.TimeoutBehavior == TimeoutBehavior.Succeed)
{
// The subscription query is one where it is successful if there is no error returned
// Since we've received a data update for the subscription we can assume the subscribe query was successful
// Call timeout to complete
SubscriptionQuery.Timeout();
}
return route.Handle(connection, receiveTime, originalData, data); return route.Handle(connection, receiveTime, originalData, data);
} }