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

Do not use SO_REUSEPORT on WSL #81

Closed
pixelspark opened this issue Aug 1, 2017 · 1 comment
Closed

Do not use SO_REUSEPORT on WSL #81

pixelspark opened this issue Aug 1, 2017 · 1 comment

Comments

@pixelspark
Copy link

pixelspark commented Aug 1, 2017

In PR #61 (e639a3f), use of the SO_REUSEPORT socket option was added. This however causes issues on Windows Subsystem for Linux (WSL), which does not (and will likely never) support SO_REUSEPORT.

Strace shows the following:

setsockopt(15, SOL_SOCKET, SO_REUSEPORT, [1], 4) = -1 ENOPROTOOPT (Protocol not available)

By the way, SO_REUSEADDR works without issue on WSL:

setsockopt(15, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0

Please consider adding a way to disable the use of SO_REUSEPORT, or do not fail with an exception (but rather silently) when the call to setsockopt fails with ENOPROTOOPT (at least on Linux). Unfortunately it is not possible to detect WSL at compile-time, as the userland is actually Ubuntu (or other Linux). A third option would be to perform detection at runtime (or perform some other check to see whether SO_REUSEPORT is available) but then again, that is probably more complicated than simply ignoring an ENOPROTOOPT error.

@billabt
Copy link
Collaborator

billabt commented Aug 1, 2017

Fixed in the latest release, 0.12.57. It now will fail silently should the errno be set to ENOPROTOOPT. Thanks.

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

2 participants