Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[paho-dev] MQTTClient_publishMessage()'s in asynchronous mode

Hello,

I made several C daemons that are publishing dynamically allocated data. PAHO is used in asynchronous mode.

Is it safe to :

dt = malloc( ... );
MQTTClient_publishMessage( dt ),
free(dt)

If not, how can I ensure data are not anymore used ?
I firstly thought to wait for delivery completion using MQTTClient_deliveryComplete() but the documentation said it doesn't work with QoS0 ... which is my case.

Thanks

Laurent


Back to the top