• @Gordon I' ve found something to improve in MQTT module.
    In some cases call of underlying require("net").connect(...) throws exception. mqo.emit('disconnected') is not called in such case. So general reconnection algorithm (reconnect on disconnected) is not working.
    So may be it is a good idea to catch the exception in MQTT module and emit disconnected event:

          try {
            client = require("net").connect({host: mqo.server, port: mqo.port}, onConnect);
          } catch (e){
            client = false;
            this.emit('disconnected');
          }
    

    It will simplify usage of MQTT module.

About

Avatar for SergeP @SergeP started