Skip to content

Commit 2e776ec

Browse files
committed
Fix reconnect
1 parent 858029c commit 2e776ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arduino-iot-client-mqtt/arduino-iot-client-mqtt.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,11 @@ class ArduinoClientMqtt {
103103
};
104104

105105
const client = mqtt.connect('wss://' + this.opts.host + ':' + this.opts.port + '/mqtt', connectionOpts);
106+
this.connection = client;
106107

107108
client.topics = {};
108109

109110
client.on("connect", () => {
110-
this.connection = client;
111111
if (typeof this.opts.onConnected === 'function') {
112112
this.opts.onConnected();
113113
}

0 commit comments

Comments
 (0)