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

rpcapd: add reuseaddr so daemon can be restarted quicky #765

Closed
bleader opened this issue Oct 3, 2018 · 0 comments · Fixed by #771
Closed

rpcapd: add reuseaddr so daemon can be restarted quicky #765

bleader opened this issue Oct 3, 2018 · 0 comments · Fixed by #771

Comments

@bleader
Copy link
Contributor

bleader commented Oct 3, 2018

In some cases (lost link then killing daemon for example), the listen port may still be in use when restarting the daemon. Using SO_REUSEADDR flag before bind() could help with this issue.

Given this is handled by the sock_open() function, I made my patch adding a call to setsockopt() before the bind() in case of server socket. This will also be applied in case of active connection, which may be unecessary but shouldn't create any issue, as far as I can tell.

The way I did it is on my fork, I wasn't able to test it on windows, but that should work, so I'll do a pull-request to check if CI builds fine.

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

Successfully merging a pull request may close this issue.

2 participants