Re: MQTT
Date: Thu, 16 Apr 2020 08:59:51 +0200
Hi Daniel,
> Do brokers ever send DISCONNECT in normal circumstances?
No, in MQTT Version 3.1.1 DISCONNECT is only used by clients to indicate a graceful shutdown of the connection.
In the new MQTT Version 5 (https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.pdf <https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.pdf>) servers/brokers do send DISCONNECT to indicate the reason of shutting down the connection.
MQTT Version 5 is not (yet) implemented by all brokers. Even brokers implementing MQTT Version 5 do usually keep MQTT Version 3.1.1 for backward client compatibilty.
>
>> curl should either disconnect after a certain number of PUBLISH messages was received and after a timeout if no (new) message were received.
>
> Good feedback indeed.
>
> libcurl users can basically accomplish that using existing callbacks.
>
> For command line tool users, I suspect we need to add options for this.
If you intend to use long-lived sessions, you will have to implement the PINGREQ/PINGRESP handshake which corresponds to Keep Alive interval agreed in the CONNECT message.
Cheers
Christpoh
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2020-04-16