Skip to main content

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

Hello,

I have a second program having the same problem : random crashes.
It uses multi-threading as well and MQTT publishing and subscription using Paho-C

Can you please tell me if it's safe the way I'm publishing data ?
And if not, how can I manage safely my data ?

Thanks

Laurent

----
Le Lundi 12 octobre 2015 12h30, Laurent FAILLIE <l_faillie@xxxxxxxxx> a écrit :


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