Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[paho-dev] Paho Async callbacks

Hi Everyone at Paho

I am working with a build of Paho for Windows CE using the Async APIs and I have seen some unexpected behaviour.

I create an MQTTAysnc_connectOptions structure which includes MQTTAsync_onSuccess and MQTTAsync_onFailure callbacks, and use that to make a connection.

When the connection fails because the broker does not respond MQTTAsync_onFailure is called after the timeout period with response = null which is fine. But when the connection fails because the broker returns a CONNACK message with something other than 0 MQTTAsync_onFailure is called with response pointing to some information about the CONNACK message, and is then called called again after the timeout period with response = null.

Is there a clean way to close down the connection during the first callback, I tried MQTTAsync_destroy but that causes memory access exceptions.



Thanks

Mark




Back to the top