Skip to content

Commit 79413ea

Browse files
author
BiffoBear
committed
Shortened the socket.socket__exit__ timeout from 1000 to 19 secs to match default hardware setting.
1 parent 0144787 commit 79413ea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

adafruit_wiznet5k/adafruit_wiznet5k_socket.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,12 +243,12 @@ def __exit__(self, exc_type, exc_val, exc_tb) -> None:
243243
self._disconnect()
244244
stamp = time.monotonic()
245245
while self._status == wiznet5k.adafruit_wiznet5k.SNSR_SOCK_FIN_WAIT:
246-
if time.monotonic() - stamp > 1000:
246+
if time.monotonic() - stamp > 19: # Hardware default timeout.
247247
raise RuntimeError("Failed to disconnect socket")
248248
self.close()
249249
stamp = time.monotonic()
250250
while self._status != wiznet5k.adafruit_wiznet5k.SNSR_SOCK_CLOSED:
251-
if time.monotonic() - stamp > 1000:
251+
if time.monotonic() - stamp > 19: # Hardware default timeout.
252252
raise RuntimeError("Failed to close socket")
253253

254254
@property

0 commit comments

Comments
 (0)