Closed pirakleous closed 7 years ago
in what sense you want to receive a message? from the broker?
in clientDisconnected event of broker. when shutdown a client (esp8266) without closing the connection it takes too match time to realise that the client is disconnected.
That is mostly related to your kernel network stack, tcp timeouts and so on. There is not much you can do from the Node point of view.
You might consider setting https://nodejs.org/api/net.html#net_socket_settimeout_timeout_callback and https://nodejs.org/api/net.html#net_socket_setkeepalive_enable_initialdelay.
The tcp socket is on the stream property of https://github.com/mcollina/mosca/blob/master/lib/client.js#L42
https://github.com/mqttjs/mqtt-connection/blob/master/connection.js#L29.
Hello, i want to ask if it is possible to receive clientDisconnected message when a client loses its connection or shutdown.