Type Definition paho_mqtt3as_sys::MQTTAsync_connectionLost [] [src]

type MQTTAsync_connectionLost = Option<unsafe extern "C" fn(_: *mut c_void, _: *mut c_char)>;

This is a callback function. The client application must provide an implementation of this function to enable asynchronous notification of the loss of connection to the server. The function is registered with the client library by passing it as an argument to MQTTAsync_setCallbacks(). It is called by the client library if the client loses its connection to the server. The client application must take appropriate action, such as trying to reconnect or reporting the problem. This function is executed on a separate thread to the one on which the client application is running. @param context A pointer to the context value originally passed to MQTTAsync_setCallbacks(), which contains any application-specific context. @param cause The reason for the disconnection. Currently, cause is always set to NULL.