Skip to content
This repository was archived by the owner on Oct 28, 2023. It is now read-only.

Commit 50de6d2

Browse files
committed
extmod/modlwip: accept: Fix error code for non-blocking mode.
In non-blocking mode, if no pending connection available, should return EAGAIN, not ETIMEDOUT.
1 parent 5da8de2 commit 50de6d2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

extmod/modlwip.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,9 @@ STATIC mp_obj_t lwip_socket_accept(mp_obj_t self_in) {
732732

733733
// accept incoming connection
734734
if (socket->incoming.connection == NULL) {
735-
if (socket->timeout != -1) {
735+
if (socket->timeout == 0) {
736+
mp_raise_OSError(MP_EAGAIN);
737+
} else if (socket->timeout != -1) {
736738
for (mp_uint_t retries = socket->timeout / 100; retries--;) {
737739
mp_hal_delay_ms(100);
738740
if (socket->incoming.connection != NULL) break;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy