Skip to content

Commit

Permalink
Changed _SNSR_SOCK_FIN_WAIT back to SNSR_SOCK_FIN_WAIT as it is used …
Browse files Browse the repository at this point in the history
…in adafruit_wiznet5k_wsgiserver.py.
  • Loading branch information
BiffoBear committed Jan 14, 2023
1 parent 5fa7b6f commit f8a2f7c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions adafruit_wiznet5k/adafruit_wiznet5k.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
_SNSR_SOCK_SYNSENT = const(0x15)
SNSR_SOCK_SYNRECV = const(0x16)
SNSR_SOCK_ESTABLISHED = const(0x17)
_SNSR_SOCK_FIN_WAIT = const(0x18)
SNSR_SOCK_FIN_WAIT = const(0x18)
_SNSR_SOCK_CLOSING = const(0x1A)
_SNSR_SOCK_TIME_WAIT = const(0x1B)
_SNSR_SOCK_CLOSE_WAIT = const(0x1C)
Expand Down Expand Up @@ -825,7 +825,7 @@ def socket_open(self, socket_num: int, conn_mode: int = _SNMR_TCP) -> int:
if status in (
SNSR_SOCK_CLOSED,
_SNSR_SOCK_TIME_WAIT,
_SNSR_SOCK_FIN_WAIT,
SNSR_SOCK_FIN_WAIT,
_SNSR_SOCK_CLOSE_WAIT,
_SNSR_SOCK_CLOSING,
_SNSR_SOCK_UDP,
Expand Down Expand Up @@ -1051,7 +1051,7 @@ def socket_write(
if self.socket_status(socket_num)[0] in (
SNSR_SOCK_CLOSED,
_SNSR_SOCK_TIME_WAIT,
_SNSR_SOCK_FIN_WAIT,
SNSR_SOCK_FIN_WAIT,
_SNSR_SOCK_CLOSE_WAIT,
_SNSR_SOCK_CLOSING,
) or (timeout and time.monotonic() - stamp > timeout):
Expand Down
4 changes: 2 additions & 2 deletions adafruit_wiznet5k/adafruit_wiznet5k_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ 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:
while self.status == wiznet5k.adafruit_wiznet5k.SNSR_SOCK_FIN_WAIT:
if time.monotonic() - stamp > 1000:
raise RuntimeError("Failed to disconnect socket")
self.close()
Expand Down Expand Up @@ -228,7 +228,7 @@ def connected(self) -> bool:
wiznet5k.adafruit_wiznet5k.SNSR_SOCK_CLOSED,
wiznet5k.adafruit_wiznet5k.SNSR_SOCK_LISTEN,
wiznet5k.adafruit_wiznet5k._SNSR_SOCK_TIME_WAIT,
wiznet5k.adafruit_wiznet5k._SNSR_SOCK_FIN_WAIT,
wiznet5k.adafruit_wiznet5k.SNSR_SOCK_FIN_WAIT,
)
if not result and status != wiznet5k.adafruit_wiznet5k.SNSR_SOCK_LISTEN:
self.close()
Expand Down

0 comments on commit f8a2f7c

Please sign in to comment.