public void Send(string client, Publish publish) { NamedConnection conn; if (_allConnections.TryGetValue(client, out conn)) { conn.Send(publish); } }
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); }