Ejemplo n.º 1
0
 public void Send(string client, Publish publish)
 {
     NamedConnection conn;
     if (_allConnections.TryGetValue(client, out conn))
     {
         conn.Send(publish);
     }
 }
Ejemplo n.º 2
0
        public Task Publish(string topic, string message, QualityOfService qos, Action<MqttCommand> completed)
        {
            var pub = new Publish(topic, message);
            pub.Header.QualityOfService = qos;
            if (qos != QualityOfService.AtMostOnce)
            {
                pub.MessageId = _idSeq.Next();
            }

            var publish = new PublishSendFlow(_manager);
            return publish.Start(pub, completed);
        }