Hi Mark,
it's a bug. If you change line 1303 in MQTTAsync.c from
MQTTAsync_disconnect_internal(m, 0);
to
MQTTProtocol_closeSession(m->c, 0);
you should find it works better. I will raise a bug and fix it, unless you want to raise the bug yourself?
Did you have to change much to get it to work on WinCE (what version?) ? I thought a number of changes would be required. If so,
I'd be interested in getting them into the source code.
Ian
On 30/04/13 14:53, Cullen, Mark wrote:
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
_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/paho-dev