blob: 4060df85eb8deb199a4c0233616a45d2358557f3 [file] [log] [blame]
.TH "async" 3 "Thu Sep 13 2018" "Paho Asynchronous MQTT C Client Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
async \- Threading
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 \fBMQTTAsync_setCallbacks()\fP (see \fBMQTTAsync_messageArrived()\fP, \fBMQTTAsync_connectionLost()\fP and \fBMQTTAsync_deliveryComplete()\fP)\&. In addition, some functions allow success and failure callbacks to be set for individual requests, in the \fBMQTTAsync_responseOptions\fP 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 https://bugs.eclipse.org/bugs/show_bug.cgi?id=444093)