make mirror on github.com
also remove a disconnet on the first start
This commit is contained in:
parent
51bfd52095
commit
9a94ff97d2
@ -12,6 +12,7 @@ namespace BlubbFish.Utils.IoT.Connector.Data {
|
|||||||
private MqttClient client;
|
private MqttClient client;
|
||||||
private Thread connectionWatcher;
|
private Thread connectionWatcher;
|
||||||
private Boolean connectionWatcherRunning;
|
private Boolean connectionWatcherRunning;
|
||||||
|
private Boolean firstStart = true;
|
||||||
|
|
||||||
public Mqtt(Dictionary<String, String> settings) : base(settings) {
|
public Mqtt(Dictionary<String, String> settings) : base(settings) {
|
||||||
Console.WriteLine("BlubbFish.Utils.IoT.Connector.Data.Mqtt(" + this.ToString()+")");
|
Console.WriteLine("BlubbFish.Utils.IoT.Connector.Data.Mqtt(" + this.ToString()+")");
|
||||||
@ -62,11 +63,15 @@ namespace BlubbFish.Utils.IoT.Connector.Data {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void Reconnect() {
|
private void Reconnect() {
|
||||||
|
if(!this.firstStart) {
|
||||||
if(this.IsConnected) {
|
if(this.IsConnected) {
|
||||||
this.Disconnect(true);
|
this.Disconnect(true);
|
||||||
} else {
|
} else {
|
||||||
this.Disconnect(false);
|
this.Disconnect(false);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
this.firstStart = false;
|
||||||
|
}
|
||||||
this.Connect();
|
this.Connect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
# BlubbFish.Utils.IoT.Connector.Data.Mqtt (ConnectorDataMqtt)
|
# BlubbFish.Utils.IoT.Connector.Data.Mqtt (ConnectorDataMqtt)
|
||||||
Library that connects to Mqtt using M2Mqtt
|
Library that connects to Mqtt using M2Mqtt
|
||||||
|
|
||||||
|
Maybe you find this Repo on Github. This is a mirror from [here](https://git.blubbfish.net/vs_utils/ConnectorDataMqtt).
|
||||||
|
|
||||||
## Linking to
|
## Linking to
|
||||||
### Internal
|
### Internal
|
||||||
* BlubbFish.Utils.IoT ([Utils-IoT](http://git.blubbfish.net/vs_utils/Utils-IoT))
|
* BlubbFish.Utils.IoT ([Utils-IoT](http://git.blubbfish.net/vs_utils/Utils-IoT))
|
||||||
|
|
||||||
### External
|
### External
|
||||||
* M2Mqtt
|
* M2Mqtt ([Used Fork](https://github.com/blubbfish/mqtt), [Original](https://github.com/eclipse/paho.mqtt.m2mqtt))
|
Loading…
Reference in New Issue
Block a user