Listener: function () {}
Fires when qnode is at its first time of registering to the LwMQN Server successfully. If qnode has registered before, only the 'login' event will be fired at each success of registration.
Listener: function () {}
Fires when qnode deregisters from the LWMQN Server successfully.
Listener: function () {}
Fires when qnode connects and login to the Server successfully.
Listener: function () {}
Fires when qnode disconnects and logout from the Server successfully.
Listener: function () {}
Fires when qnode starts to reconnect to the Server.
Listener: function () {}
Fires when qnode loses its connection to the Server, e.g., the Server is down or qnode goes offline.
Listener: function (topic, message, packet) {}
Fires when qnode receives a generic publish packet. You should have your own message listener if you'd like to subscribe to generic MQTT topics.
topic
(String): topic of the received packetmessage
(Buffer | String): payload of the received packetpacket
(Object): received packet, as defined in mqtt-packet
Listener: function (err) {}
- The low-layer errors from mqtt.js will propagate through this event.
- When invoking
connect()
orclose()
methods without a callback, the error occurring in these methods will be fired along with theerror
event instead. - Most importantly, if there is no
error
event listener attached on qnode, errors will be rethrown to crash your program.