← Back to team overview

mqtt-users team mailing list archive

libmosquitto async publishing

 

Hi,

With libmosquitto, how does the caller find out if a request to publish has failed? mosquitto_publish() returns an error code immediately, but I assume that publishing is asynchronous as mosquitto_publish_callback_set() exists.

The callback passed to mosquitto_publish_callback_set() only gets fed the context, mid and userdata.

Is there a way to discover that an asynchronous request to publish has failed?
Or is it that libmosquitto will always publish or fail immediately?

Thanks.

--


Follow ups