Skip to main content

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

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.




Back to the top