Skip to content
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

Can't restart servers due to missing SO_REUSEADDR #72

Open
iabdalkader opened this issue Jul 26, 2021 · 0 comments
Open

Can't restart servers due to missing SO_REUSEADDR #72

iabdalkader opened this issue Jul 26, 2021 · 0 comments

Comments

@iabdalkader
Copy link
Contributor

iabdalkader commented Jul 26, 2021

It's not possible to re-bind a server socket to the same port because SO_REUSEADDR is not set on server sockets, and AFAIK there's no function to set socket-level options. The second time bind() is called with the same port it fails and the socket is closed, in WiFiServer::begin() here:

https://github.com/arduino/nina-fw/blob/master/arduino/libraries/WiFi/src/WiFiServer.cpp#L57

What makes it worse is the result from begin() is completely ignored:

https://github.com/arduino/nina-fw/blob/master/main/CommandHandler.cpp#L406

Also it seems the port never becomes free again ever without a hard-reset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant