We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d8f2f24 commit b4ef1d3Copy full SHA for b4ef1d3
1 file changed
nodes/core/io/lib/mqtt.js
@@ -79,7 +79,10 @@ MQTTClient.prototype.connect = function(options) {
79
var now = (new Date()).getTime();
80
if (now - self.lastOutbound > self.options.keepalive*500 || now - self.lastInbound > self.options.keepalive*500) {
81
if (self.pingOutstanding) {
82
- self.client.disconnect();
+ try {
83
+ self.client.disconnect();
84
+ } catch (err) {
85
+ }
86
} else {
87
self.lastOutbound = (new Date()).getTime();
88
self.lastInbound = (new Date()).getTime();
@@ -216,7 +219,10 @@ MQTTClient.prototype.disconnect = function() {
216
219
var self = this;
217
220
if (this.connected) {
218
221
this.connected = false;
- this.client.disconnect();
222
223
+ this.client.disconnect();
224
+ } catch(err) {
225
226
}
227
228
MQTTClient.prototype.isConnected = function() {
0 commit comments