-
Notifications
You must be signed in to change notification settings - Fork 36
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Related, but separate, to #89
There are at least two hardcoded timeouts for 1000:
Adafruit_CircuitPython_Wiznet5k/adafruit_wiznet5k/adafruit_wiznet5k_socket.py
Lines 178 to 189 in 73bb5b6
| def __exit__(self, exc_type, exc_val, exc_tb) -> None: | |
| if self._sock_type == SOCK_STREAM: | |
| self.disconnect() | |
| stamp = time.monotonic() | |
| while self.status == wiznet5k.adafruit_wiznet5k.SNSR_SOCK_FIN_WAIT: | |
| if time.monotonic() - stamp > 1000: | |
| raise RuntimeError("Failed to disconnect socket") | |
| self.close() | |
| stamp = time.monotonic() | |
| while self.status != wiznet5k.adafruit_wiznet5k.SNSR_SOCK_CLOSED: | |
| if time.monotonic() - stamp > 1000: | |
| raise RuntimeError("Failed to close socket") |
I believe time.monotonic() returns the number of seconds. Waiting 1,000 seconds (over 16 minutes) in the __exit__ block is far too long.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request