|
35 | 35 | import time |
36 | 36 | from random import randint |
37 | 37 |
|
38 | | -from adafruit_connection_manager import ( |
39 | | - get_connection_manager, |
40 | | - SocketGetOSError, |
41 | | - SocketConnectMemoryError, |
42 | | -) |
| 38 | +from adafruit_connection_manager import get_connection_manager |
43 | 39 |
|
44 | 40 | try: |
45 | 41 | from typing import List, Optional, Tuple, Type, Union |
|
87 | 83 | _default_sock = None # pylint: disable=invalid-name |
88 | 84 | _fake_context = None # pylint: disable=invalid-name |
89 | 85 |
|
90 | | -TemporaryError = (SocketGetOSError, SocketConnectMemoryError) |
91 | | - |
92 | 86 |
|
93 | 87 | class MMQTTException(Exception): |
94 | 88 | """MiniMQTT Exception class.""" |
@@ -430,8 +424,8 @@ def connect( |
430 | 424 | ) |
431 | 425 | self._reset_reconnect_backoff() |
432 | 426 | return ret |
433 | | - except TemporaryError as e: |
434 | | - self.logger.warning(f"temporary error when connecting: {e}") |
| 427 | + except RuntimeError as e: |
| 428 | + self.logger.warning(f"Socket error when connecting: {e}") |
435 | 429 | backoff = False |
436 | 430 | except MMQTTException as e: |
437 | 431 | last_exception = e |
@@ -486,8 +480,6 @@ def _connect( |
486 | 480 | timeout=self._socket_timeout, |
487 | 481 | is_ssl=self._is_ssl, |
488 | 482 | ssl_context=self._ssl_context, |
489 | | - max_retries=1, # setting to 1 since we want to handle backoff internally |
490 | | - exception_passthrough=True, |
491 | 483 | ) |
492 | 484 |
|
493 | 485 | fixed_header = bytearray([0x10]) |
|
0 commit comments