Merge pull request #13205 from kjbracey-arm/lwipnonblock

LWIPStack: set sockets non-blocking
pull/13223/head
Martin Kojtal 2020-07-01 12:29:22 +02:00 committed by GitHub
commit 663492a24f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 5 deletions

View File

@ -271,7 +271,7 @@ nsapi_error_t LWIP::socket_open(nsapi_socket_t *handle, nsapi_protocol_t proto)
return NSAPI_ERROR_NO_SOCKET;
}
netconn_set_recvtimeout(s->conn, 1);
netconn_set_nonblocking(s->conn, true);
*(struct mbed_lwip_socket **)handle = s;
return 0;
}
@ -376,7 +376,7 @@ nsapi_error_t LWIP::socket_accept(nsapi_socket_t server, nsapi_socket_t *handle,
return err_remap(err);
}
netconn_set_recvtimeout(ns->conn, 1);
netconn_set_nonblocking(ns->conn, true);
*(struct mbed_lwip_socket **)handle = ns;
ip_addr_t peer_addr;
@ -390,8 +390,6 @@ nsapi_error_t LWIP::socket_accept(nsapi_socket_t server, nsapi_socket_t *handle,
address->set_port(port);
}
netconn_set_nonblocking(ns->conn, true);
return 0;
#else
return NSAPI_ERROR_UNSUPPORTED;

View File

@ -201,7 +201,6 @@
#define LWIP_COMPAT_SOCKETS 0
#define LWIP_POSIX_SOCKETS_IO_NAMES 0
#define LWIP_SO_RCVTIMEO 1
#define LWIP_BROADCAST_PING 1