We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7ec24b0 commit 4d2d15bCopy full SHA for 4d2d15b
1 file changed
src/paho/mqtt/client.py
@@ -3276,7 +3276,7 @@ def _check_keepalive(self) -> None:
3276
last_msg_in = self._last_msg_in
3277
3278
if self._sock is not None and (now - last_msg_out >= self._keepalive or now - last_msg_in >= self._keepalive):
3279
- if self._state == _ConnectionState.MQTT_CS_CONNECTED:
+ if self._state == _ConnectionState.MQTT_CS_CONNECTED and (self._ping_t == 0 or now - last_msg_in < self.keepalive):
3280
try:
3281
self._send_pingreq()
3282
except Exception:
0 commit comments