pull/8/head
Chris Laws 2015-11-02 23:05:37 +10:30
rodzic 602cf473f2
commit 8f729cfdbc
1 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -95,8 +95,8 @@ class ClientProtocolHandler(ProtocolHandler):
def handle_write_timeout(self): def handle_write_timeout(self):
try: try:
self.logger.debug("Scheduling Ping")
if not self._ping_task: if not self._ping_task:
self.logger.debug("Scheduling Ping")
self._ping_task = ensure_future(self.mqtt_ping()) self._ping_task = ensure_future(self.mqtt_ping())
except BaseException as be: except BaseException as be:
self.logger.debug("Exception ignored in ping task: %r" % be) self.logger.debug("Exception ignored in ping task: %r" % be)
@ -167,6 +167,8 @@ class ClientProtocolHandler(ProtocolHandler):
self._pingresp_waiter = futures.Future(loop=self._loop) self._pingresp_waiter = futures.Future(loop=self._loop)
resp = yield from self._pingresp_queue.get() resp = yield from self._pingresp_queue.get()
self._pingresp_waiter = None self._pingresp_waiter = None
if self._ping_task:
self._ping_task = None
return resp return resp
@asyncio.coroutine @asyncio.coroutine