Skip to content

Commit

Permalink
Merge pull request #153 from us3r64/fix/socket-httpserver-poll
Browse files Browse the repository at this point in the history
Fix socket accept flow and timeout code
  • Loading branch information
FoamyGuy authored Apr 22, 2024
2 parents 2b0358e + 6a90f75 commit 9cfd92f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion adafruit_wiznet5k/adafruit_wiznet5k_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import gc
from sys import byteorder
from errno import ETIMEDOUT

from micropython import const
from adafruit_ticks import ticks_ms, ticks_diff
Expand Down Expand Up @@ -400,6 +401,7 @@ def accept(
while self._status not in (
wiznet5k.adafruit_wiznet5k.SNSR_SOCK_SYNRECV,
wiznet5k.adafruit_wiznet5k.SNSR_SOCK_ESTABLISHED,
wiznet5k.adafruit_wiznet5k.SNSR_SOCK_LISTEN,
):
if (
self._timeout
Expand Down Expand Up @@ -778,7 +780,7 @@ class timeout(TimeoutError):
the timeout has elapsed and we haven't received any data yet."""

def __init__(self, msg):
super().__init__(msg)
super().__init__(ETIMEDOUT, msg)


# pylint: enable=unused-argument, redefined-builtin, invalid-name

0 comments on commit 9cfd92f

Please sign in to comment.