From 7ce1c6263790b00559228794bb940f601489c1f3 Mon Sep 17 00:00:00 2001 From: Nicolas Jouanin Date: Mon, 27 Jul 2015 15:00:50 +0200 Subject: [PATCH] Fix keep_alive conformance test HBMQTT-12 --- hbmqtt/broker.py | 2 +- hbmqtt/mqtt/protocol/handler.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hbmqtt/broker.py b/hbmqtt/broker.py index dd95634..ef6840a 100644 --- a/hbmqtt/broker.py +++ b/hbmqtt/broker.py @@ -16,7 +16,7 @@ from hbmqtt.utils import format_client_message, gen_client_id _defaults = { 'bind-address': 'localhost', 'bind-port': 1883, - 'timeout-disconnect-delay': 10 + 'timeout-disconnect-delay': 2 } diff --git a/hbmqtt/mqtt/protocol/handler.py b/hbmqtt/mqtt/protocol/handler.py index b55b5ae..6dc173b 100644 --- a/hbmqtt/mqtt/protocol/handler.py +++ b/hbmqtt/mqtt/protocol/handler.py @@ -136,6 +136,7 @@ class ProtocolHandler: keepalive_timeout = self.session.keep_alive if keepalive_timeout <= 0: keepalive_timeout = None + self.logger.debug("Read keepalive timeout=%s s" % str(keepalive_timeout)) fixed_header = yield from asyncio.wait_for(MQTTFixedHeader.from_stream(self.session.reader), keepalive_timeout) if fixed_header: cls = packet_class(fixed_header)