1
0
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:
Jkorf 2026-02-09 12:57:52 +01:00
parent 759c8b9a58
commit abda065237

View File

@ -633,22 +633,38 @@ 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)
{ {
processed = true; if (route.TopicFilter != null)
// No topic on message, but route is filtering on topic
if (isQuery && query!.Completed)
continue; continue;
processor.Handle(this, receiveTime, originalData, result, route);
if (isQuery && !route.MultipleReaders)
{
complete = true;
break;
}
} }
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;
if (isQuery && query!.Completed)
continue;
processor.Handle(this, receiveTime, originalData, result, route);
if (isQuery && !route.MultipleReaders)
{
complete = true;
break;
}
} }
if (complete) if (complete)