Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[paho-dev] When to invoke MQTTClient_disconnect() and MQTTClient_destroy() in long running application ?


Our application using paho c mqtt library (version 1.3.0). Recently we have noticed few issues (mostly crashes in library) when application is reconnecting (disconnection, destroy and then connect) to the broker. We are reconnecting to broker when MQTTClient_isConnected() returns false. As I'm new to paho library, I have below queries designing application code with respect to paho library.
1) If underlying library is disconnected from broker due to any network issue, does the application need to reset the connection by destroying existing mqtt client handle ?
2) Can application code use the handle created at initialisation during entire run time of the process ? Will there be any case where application need to reset the existing connection ?

The device on which our application runs, might switch the interfaces and cause network issues.


Back to the top