diff --git a/src/paho/mqtt/client.py b/src/paho/mqtt/client.py index 4ccc8696..58ce2b15 100644 --- a/src/paho/mqtt/client.py +++ b/src/paho/mqtt/client.py @@ -3180,6 +3180,10 @@ def _packet_write(self) -> MQTTErrorCode: return MQTTErrorCode.MQTT_ERR_CONN_LOST if write_length > 0: + # Update the last message out time once packet (partial packet) is sent + with self._msgtime_mutex: + self._last_msg_out = time_func() + packet['to_process'] -= write_length packet['pos'] += write_length