Skip to content

adafruit_minimqtt: Fix issue #86 with multiple poll() PINGREQs #87

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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