Skip to content

LWIPStack: set sockets non-blocking #13205

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions features/lwipstack/LWIPStack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down
1 change: 0 additions & 1 deletion features/lwipstack/lwipopts.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down