Skip to content

Commit 0659bb5

Browse files
authored
Raise exception in recv_from() in non-blocking mode
1 parent 4502430 commit 0659bb5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

adafruit_wiznet5k/adafruit_wiznet5k_socketpool.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,10 @@ def recv_into( # pylint: disable=unused-argument
632632
continue
633633
if self._timeout == 0:
634634
# non-blocking mode
635-
break
635+
if num_read == 0:
636+
raise OSError(errno.EAGAIN)
637+
else:
638+
break
636639
if ticks_diff(ticks_ms(), last_read_time) / 1000 > self._timeout:
637640
raise OSError(errno.ETIMEDOUT)
638641
return num_read

0 commit comments

Comments
 (0)