diff --git a/src/paho/mqtt/client.py b/src/paho/mqtt/client.py index 14aed7cf..4538d6c4 100644 --- a/src/paho/mqtt/client.py +++ b/src/paho/mqtt/client.py @@ -4313,7 +4313,7 @@ def _recv_impl(self, length: int) -> bytes: else: raise BlockingIOError - except OSError: + except ConnectionError: self.connected = False return b''