AWS IoT Device SDK C:
MQTT
MQTT 3.1.1 client library
|
Return to main page ↑ |
Waits for an operation to complete.
This function blocks to wait for a subscribe, unsubscribe, or publish to complete. These operations are by default asynchronous; the function calls queue an operation for processing, and a callback is invoked once the operation is complete.
To use this function, the flag IOT_MQTT_FLAG_WAITABLE must have been set in the operation's function call. Additionally, this function must always be called with any waitable operation to clean up resources.
Regardless of its return value, this function always clean up resources used by the waitable operation. This means reference
is invalidated as soon as this function returns, even if it returns IOT_MQTT_TIMEOUT or another error.
[in] | operation | Reference to the operation to wait for. The flag IOT_MQTT_FLAG_WAITABLE must have been set for this operation. |
[in] | timeoutMs | How many milliseconds to wait before returning IOT_MQTT_TIMEOUT. |
reference
. See IotMqttError_t for possible return values.Example