예제 #1
0
 public void Send(string client, Publish publish)
 {
     NamedConnection conn;
     if (_allConnections.TryGetValue(client, out conn))
     {
         conn.Send(publish);
     }
 }
예제 #2
0
파일: Client.cs 프로젝트: 4058665/MQTT
        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);
        }