Hello,

> 
> I tried doing:
> 
> ./curl 'mqtt://test.mosquitto.org/de.wsv/pegel/cm/ems/emshoern' --output -
> 
> That topic currently has a retained message with content "582". The
> response I get from curl is:
> 
> curl: (8) Weird server reply
> de.wsv/pegel/cm/ems/emshoern582

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.
> 
>> ./curl mqtt://test.mosquitto.org/de.wsv/#
>> ./curl 'mqtt://test.mosquitto.org/de.wsv/#'
>> 
>> Which I would expect would subscribe using the multilevel wildcard '#'. I 
>> tried both forms to try and be sure that it wasn't the shell swallowing the 
>> #.
> 
> '#' is special in URLs, as it marks a fragment. You need to URL encoded such 
> characters as %23.
> 

Good to know!
> 
> 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.

curl should either disconnect after a certain number of PUBLISH messages was 
received and after a timeout if no (new) message were received.






-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
  • MQTT Daniel Stenberg via curl-library
    • Re: MQTT Daniel Stenberg via curl-library
    • Re: MQTT Roger Light via curl-library
      • Re: MQTT Daniel Stenberg via curl-library
        • Re: MQTT Daniel Stenberg via curl-library
    • Re: MQTT Christoph Krey via curl-library
      • Re: MQTT Daniel Stenberg via curl-library
        • Re: MQTT Christoph Krey via curl-library

Reply via email to