mirror of
https://github.com/JKorf/CryptoExchange.Net
synced 2026-02-16 14:13:46 +00:00
Updated websocket message forwarding logic
This commit is contained in:
parent
759c8b9a58
commit
abda065237
@ -633,10 +633,26 @@ namespace CryptoExchange.Net.Sockets.Default
|
|||||||
if (route.TypeIdentifier != typeIdentifier)
|
if (route.TypeIdentifier != typeIdentifier)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (topicFilter == null
|
// Forward message rules:
|
||||||
|| route.TopicFilter == null
|
// | Message Topic | Route Topic Filter | Topics Match | Forward | Description
|
||||||
|| route.TopicFilter.Equals(topicFilter, StringComparison.Ordinal))
|
// | N | N | - | Y | No topic filter applied
|
||||||
|
// | N | Y | - | N | Route only listens to specific topic
|
||||||
|
// | Y | N | - | Y | Route listens to all message regardless of topic
|
||||||
|
// | Y | Y | Y | Y | Route listens to specific message topic
|
||||||
|
// | Y | Y | N | N | Route listens to different topic
|
||||||
|
if (topicFilter == null)
|
||||||
{
|
{
|
||||||
|
if (route.TopicFilter != null)
|
||||||
|
// No topic on message, but route is filtering on topic
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (route.TopicFilter != null && !route.TopicFilter.Equals(topicFilter, StringComparison.Ordinal))
|
||||||
|
// Message has a topic, and the route has a filter for another topic
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
processed = true;
|
processed = true;
|
||||||
|
|
||||||
if (isQuery && query!.Completed)
|
if (isQuery && query!.Completed)
|
||||||
@ -648,7 +664,7 @@ namespace CryptoExchange.Net.Sockets.Default
|
|||||||
complete = true;
|
complete = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (complete)
|
if (complete)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user