|
Re: Mosquitto and TCP session [message #1835856 is a reply to message #1835799] |
Tue, 15 December 2020 09:59 |
Roger Light Messages: 90 Registered: September 2013 |
Member |
|
|
Hi Emanuele,
Depending on the MQTT options you set when connecting, an MQTT session will either end at the same time as the TCP connection ends, or will outlive it. In MQTT v3.x, if you set the "clean session" flag to true, then the MQTT session will end at the same time as the TCP connection. If you set it to false, the MQTT session will remain beyond the TCP connection. For MQTT v5.0, the same behaviour is controlled by the session-expiry-interval property. When the TCP connection ends, if the session-expiry-interval is 0, then the MQTT session ends immediately. Otherwise, the MQTT session will end after the number of seconds defined in session-expiry-interval.
If the TCP connection has ended, the client is no longer connected to the broker and so it won't be able to send any more MQTT messages until it reconnects.
I hope that helps.
Roger
|
|
|
Powered by
FUDForum. Page generated in 0.02862 seconds