Skip to content

Commit

Permalink
Merge pull request #87 from DynamicDevices/ajl/fix-multiple-pingreqs
Browse files Browse the repository at this point in the history
adafruit_minimqtt: Fix issue #86 with multiple poll() PINGREQs
  • Loading branch information
brentru authored Aug 9, 2021
2 parents eccc36f + 0a1b340 commit 62d1921
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion adafruit_minimqtt/adafruit_minimqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -776,13 +776,13 @@ def loop(self, timeout=1):
self._timestamp = time.monotonic()
current_time = time.monotonic()
if current_time - self._timestamp >= self.keep_alive:
self._timestamp = 0
# Handle KeepAlive by expecting a PINGREQ/PINGRESP from the server
if self.logger is not None:
self.logger.debug(
"KeepAlive period elapsed - requesting a PINGRESP from the server..."
)
rcs = self.ping()
self._timestamp = 0
return rcs
self._sock.settimeout(timeout)
rc = self._wait_for_msg()
Expand Down

0 comments on commit 62d1921

Please sign in to comment.