kopia lustrzana https://github.com/Yakifo/amqtt
Handle pingreq
rodzic
c744169a7d
commit
ec8b73cfaf
|
@ -18,3 +18,7 @@ class PingRespPacket(MQTTPacket):
|
|||
super().__init__(header)
|
||||
self.variable_header = None
|
||||
self.payload = None
|
||||
|
||||
@classmethod
|
||||
def build(cls):
|
||||
return cls()
|
|
@ -47,3 +47,7 @@ class BrokerProtocolHandler(ProtocolHandler):
|
|||
# TODO : implements this correcly (manage authentication, cleansession, ...)
|
||||
self.logger.debug("Connect received")
|
||||
yield from self.outgoing_queue.put(ConnackPacket.build(0, ReturnCode.CONNECTION_ACCEPTED))
|
||||
|
||||
@asyncio.coroutine
|
||||
def handle_pingreq(self, pingreq: PingReqPacket):
|
||||
yield from self.outgoing_queue.put(PingRespPacket.build())
|
||||
|
|
Ładowanie…
Reference in New Issue