public Mqtt(MQTTConnection connection) { _connection = connection; _topicMatcher = new MqttTopicMatcher(); _handlers = new List <MqttHandler>(); _connection.MqttMsgPublishReceived += OnConnectionOnMqttMsgPublishReceived; }
public Mqtt(MQTTConnection connection) { _connection = connection; _topicMatcher = new MqttTopicMatcher(); _handlers = new List<MqttHandler>(); _connection.MqttMsgPublishReceived += OnConnectionOnMqttMsgPublishReceived; }
protected MqttModule(string brokerHostName, int brokerPort, string username, string password) { _thishost = new MqttHost(brokerHostName, brokerPort, username); if (!Clients.ContainsKey(_thishost)) { Clients[_thishost] = new MQTTConnection(brokerHostName, brokerPort, username, password); ClientUseCount[_thishost] = 1; } else { ClientUseCount[_thishost]++; } On = new Mqtt(Clients[_thishost]); //Publish = (topic, message) => //{ // On.Publish(topic, message); //}; }