Skip to content

Commit a0f36fc

Browse files
committed
Disconnect if no ping response, but if downloading ping again, resetting _ping_t
1 parent 0d114eb commit a0f36fc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/paho/mqtt/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2153,7 +2153,7 @@ def loop_misc(self) -> MQTTErrorCode:
21532153
now = time_func()
21542154
self._check_keepalive()
21552155

2156-
if self._ping_t > 0 and now - self._last_msg_in >= self._keepalive:
2156+
if self._ping_t > 0 and now - self._ping_t >= self._keepalive:
21572157
# client->ping_t != 0 means we are waiting for a pingresp.
21582158
# This hasn't happened in the keepalive time so we should disconnect.
21592159
self._sock_close()

0 commit comments

Comments
 (0)