curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: MQTT

From: Daniel Stenberg via curl-library <curl-library_at_cool.haxx.se>
Date: Wed, 15 Apr 2020 23:20:49 +0200 (CEST)

On Wed, 15 Apr 2020, Christoph Krey via curl-library wrote:

> in MQTT protocol, the server may start to send PUBLISH messages (especially
> if those are retained) before replying with SUBACK to a SUBSCRIBE.
>
> The current implementation in curl waits for a SUBACK or DISCONNECT after
> the SUBSCRIBE.
>
> The ‘failure’ return code in the SUBACK should be checked.

Ah, right. I clearly need more test cases to verify (and fix) exactly these
things. Thanks! I'll make this my next step in mqtt land.

>> We might need a way to tell curl to disconnect after a certain number of
>> responses or something…
>
> Other than the test broker in curl `mqttd` a real broker will not send
> DISCONNECT after sending a PUBLISH message.

I figured. That particular behavior was a shortcut I took knowingly until I
learn how things *should* be done.

Do brokers ever send DISCONNECT in normal circumstances?

> 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.

-- 
  / daniel.haxx.se | Commercial curl support up to 24x7 is available!
                   | Private help, bug fixes, support, ports, new features
                   | https://www.wolfssl.com/contact/

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2020-04-15