Skip to content

Commit 663492a

Browse files
authored
Merge pull request #13205 from kjbracey-arm/lwipnonblock
LWIPStack: set sockets non-blocking
2 parents 26b6ca6 + c2c2b19 commit 663492a

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

features/lwipstack/LWIPStack.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ nsapi_error_t LWIP::socket_open(nsapi_socket_t *handle, nsapi_protocol_t proto)
271271
return NSAPI_ERROR_NO_SOCKET;
272272
}
273273

274-
netconn_set_recvtimeout(s->conn, 1);
274+
netconn_set_nonblocking(s->conn, true);
275275
*(struct mbed_lwip_socket **)handle = s;
276276
return 0;
277277
}
@@ -376,7 +376,7 @@ nsapi_error_t LWIP::socket_accept(nsapi_socket_t server, nsapi_socket_t *handle,
376376
return err_remap(err);
377377
}
378378

379-
netconn_set_recvtimeout(ns->conn, 1);
379+
netconn_set_nonblocking(ns->conn, true);
380380
*(struct mbed_lwip_socket **)handle = ns;
381381

382382
ip_addr_t peer_addr;
@@ -390,8 +390,6 @@ nsapi_error_t LWIP::socket_accept(nsapi_socket_t server, nsapi_socket_t *handle,
390390
address->set_port(port);
391391
}
392392

393-
netconn_set_nonblocking(ns->conn, true);
394-
395393
return 0;
396394
#else
397395
return NSAPI_ERROR_UNSUPPORTED;

features/lwipstack/lwipopts.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@
201201

202202
#define LWIP_COMPAT_SOCKETS 0
203203
#define LWIP_POSIX_SOCKETS_IO_NAMES 0
204-
#define LWIP_SO_RCVTIMEO 1
205204

206205
#define LWIP_BROADCAST_PING 1
207206

0 commit comments

Comments
 (0)