extmod/modlwip: lwip_tcp_receive(): Properly handle EOF for non-blocking sock.
This commit is contained in:
parent
f30b6f0af5
commit
fef0d9818a
|
@ -451,6 +451,9 @@ STATIC mp_uint_t lwip_tcp_receive(lwip_socket_obj_t *socket, byte *buf, mp_uint_
|
|||
|
||||
// Non-blocking socket
|
||||
if (socket->timeout == 0) {
|
||||
if (socket->state == STATE_PEER_CLOSED) {
|
||||
return 0;
|
||||
}
|
||||
*_errno = EAGAIN;
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue