diff --git a/src/paho/mqtt/client.py b/src/paho/mqtt/client.py index 4ccc8696..2eb081b0 100644 --- a/src/paho/mqtt/client.py +++ b/src/paho/mqtt/client.py @@ -1704,7 +1704,11 @@ def _loop(self, timeout: float = 1.0) -> MQTTErrorCode: if rc or self._sock is None: return rc - return self.loop_misc() + rc = self.loop_misc() + if rc == MQTT_ERR_SUCCESS: + # Make the main loop to update inflight packets + return self._update_inflight() + return rc def publish( self,