You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I git clone paho.mqtt.cpp v1.2.0, build example and run async_subscibe, everything is ok
$ git status
HEAD detached at v1.2.0
$ ./src/samples/async_subscribe
\Connecting to the MQTT server...
Connection success
Subscribing to topic 'hello'for client paho_cpp_async_subcribe using QoS1
Press Q<Enter> to quit
Subscription success for token: [1]
token topic: 'hello', ...
And then I test the reconnect function
systemctl restart mosquitto.service
the error happened:
Connection lost
Reconnecting...
Connection attempt failed
Error: MQTT error [-18]: Connect or disconnect command ignored
Isn't it better to report errors through on_failure here?
At present, when I introduce the reconnection function, I must use try catch to catch the exception.
So, is there a better solution?
Similar problems also occur in the async client publish interface:
I git clone paho.mqtt.cpp v1.2.0, build example and run async_subscibe, everything is ok
And then I test the reconnect function
the error happened:
Connection lost Reconnecting... Connection attempt failed Error: MQTT error [-18]: Connect or disconnect command ignored
Isn't it better to report errors through on_failure here?
At present, when I introduce the reconnection function, I must use try catch to catch the exception.
So, is there a better solution?
Similar problems also occur in the async client publish interface:
it will throw exception when client is disconneted
The text was updated successfully, but these errors were encountered: