Paho Asynchronous MQTT C Client Library

The client application runs on several threads. Processing of handshaking and maintaining the network connection is performed in the background. This API is thread safe: functions may be called by multiple application threads. Notifications of status and message reception are provided to the client application using callbacks registered with the library by the call to MQTTAsync_setCallbacks() (see MQTTAsync_messageArrived(), MQTTAsync_connectionLost() and MQTTAsync_deliveryComplete()). In addition, some functions allow success and failure callbacks to be set for individual requests, in the MQTTAsync_responseOptions structure. Applications can be written as a chain of callback functions. Note that it is a theoretically possible but unlikely event, that a success or failure callback could be called before function requesting the callback has returned. In this case the token delivered in the callback would not yet be known to the application program (see Race condition for MQTTAsync_token in MQTTAsync.c