protected override void MqttMessageReceived(IList <string> wildcards, MqttApplicationMessageReceivedEventArgs e)
        {
            var group = wildcards[0];
            var topic = e.ApplicationMessage.ConvertPayloadToString();

            Balancer.Groups.Add(group);

            if (!Balancer.Balancers.TryGetValue(topic, out var btopic))
            {
                btopic = new TopicBalancer(Balancer, topic, Client);
            }

            btopic.SubAck(group);
        }
Esempio n. 2
0
 public CanWorkTopic(TopicBalancer listener, string topic)
     : base(topic, listener.Balancer.Client)
 {
     this.listener = listener;
 }
Esempio n. 3
0
 public OriginalTopic(TopicBalancer listener, string topic)
     : base(topic, listener.Balancer.Client)
 {
     this.listener = listener;
 }