Hi Ian,
Great, just checking to see if I might be doing something out of order. I'll keep looking. As far as which version I am using, I pulled from a commit around 6 weeks ago:
commit 4a077be7621fd4d0738781b61d7d2c0d5fc017e2
Author: Ian Craggs <icraggs@xxxxxxxxxx>
Date: Wed Dec 18 17:44:39 2013 +0000
Thanks,
Jimmy
From: paho-dev-bounces@xxxxxxxxxxx [paho-dev-bounces@xxxxxxxxxxx] on behalf of Ian Craggs [icraggs@xxxxxxxxxxxxxxxxxxxxxxx]
Sent: Wednesday, January 29, 2014 2:41 PM
To: General development discussions for paho project
Subject: Re: [paho-dev] Correct way to recover from broker disconnect?
Jimmy,
the right way is to call MQTTClient_connect, as you seem to be doing. You don't need to create another client object.
Are you using the latest client code?
Ian
On 29/01/14 21:57, Jimmy Johnson wrote:
Hello,
I am using the paho C client over ssl to connect to a mosquito broker. In tests when the broker is restarted the client disconnects but I am unable to reconnect to the broker by simply calling the MQTTClient_connect routine. What is the best way to reconnect
to a broker that goes down? Am I missing an interim step? Do I need to create a whole new client handle before trying to reconnect?
I am getting the following errors when trying to reconnect using the same client handle that just got disconnected:
20140129 183737.764 New socket 7 for m10.cloudmqtt.com, port 20893
20140129 183737.764 (3051354944) (4)> Socket_addSocket:162
20140129 183737.764 (3051354944) (5)> Socket_setnonblocking:72
20140129 183737.764 (3051354944) (5)< Socket_setnonblocking:77 (0)
20140129 183737.764 (3051354944) (4)< Socket_addSocket:175 (0)
20140129 183737.764 (3051354944) (4)> Socket_error:94
20140129 183737.764 (3051354944) (4)< Socket_error:103 (115)
20140129 183737.764 Connect pending
20140129 183737.764 (3051354944) (3)< Socket_new:682 (115)
20140129 183737.764 (3051354944) (2)< MQTTProtocol_connect:130 (115)
20140129 183737.764 (3051354944) (2)> MQTTClient_waitfor:1532
20140129 183737.764 (3051354944) (3)> Thread_wait_sem:263
20140129 183737.764 (3051354944) (3)< Thread_wait_sem:284 (0)
20140129 183737.764 (3051354944) (2)< MQTTClient_waitfor:1614 (-3)
20140129 183737.764 (3051354944) (2)> MQTTClient_disconnect1:1065
20140129 183737.764 (3051354944) (3)> MQTTClient_closeSession:645
Thanks,
Jimmy
_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/paho-dev