def _on_disconnect(self, client, userdata, rc):
logging.error('[Disconnected] Lost connection to broker')
if self._socket_watch is not None:
gobject.source_remove(self._socket_watch)
self._socket_watch = None
logging.info('[Disconnected] Set timer')
gobject.timeout_add(5000, exit_on_error, self._reconnect)
评论列表
文章目录