Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] Detecting disconnects

Andrew,

those return codes don't sound helpful.

Let's see what Roger, the author of the Python client has to say.

Ian


On 01/18/2015 01:13 AM, Andrew McClure wrote:
Am wondering the best way to manage error handling and reporting of > 0 return values from loop().

e.g. the return value from loop() after the broker has gone away is initially the rc value - typically 1 (MQTT_ERR_NOMEM)

         if self.socket() in socklist[0]:
             rc = self.loop_read(max_packets)
             if rc or (self._ssl is None and self._sock is None):
                 return rc

This is a little hard to report meaningfully. It is only on the subsequent reconnect attempt that we get the errno 61 - Connection Refused.

Am thinking that ignoring or printing a debug statement with the returned rc value is the best we can hope for.  Thanks.


_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/paho-dev

--
Ian Craggs
icraggs@xxxxxxxxxx                 IBM United Kingdom
Paho Project Lead; Committer on Mosquitto



Back to the top