Skip to content

Commit 362be1b

Browse files
author
Veijo Pesonen
committed
Fixes a bug where would-block is treated as an error
Would-block is not a reason to drop a TCP socket from a connected-state
1 parent 0418c61 commit 362be1b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ESP8266Interface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ int ESP8266Interface::socket_recv(void *handle, void *data, unsigned size)
381381
int32_t recv;
382382
if (socket->proto == NSAPI_TCP) {
383383
recv = _esp.recv_tcp(socket->id, data, size);
384-
if (recv <= 0) {
384+
if (recv <= 0 && recv != NSAPI_ERROR_WOULD_BLOCK) {
385385
socket->connected = false;
386386
}
387387
} else {

0 commit comments

Comments
 (0)