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

Don't use SO_REUSEPORT on Unix domain sockets #581

Closed
panjf2000 opened this issue Apr 21, 2024 · 1 comment · Fixed by #584
Closed

Don't use SO_REUSEPORT on Unix domain sockets #581

panjf2000 opened this issue Apr 21, 2024 · 1 comment · Fixed by #584
Milestone

Comments

@panjf2000
Copy link
Owner

panjf2000 commented Apr 21, 2024

SO_REUSEPORT on AF_LOCAL enables duplicate address and port bindings without load balancing on Linux and *BSD.

@panjf2000
Copy link
Owner Author

There is a problem when UDP sockets and Unix domain sockets are together requested to be listened by the gnet server, a conflict arises because we must use SO_REUSEPORT on UDP sockets based on the current architecture of gnet. We can disallow users to listen on both UDP sockets and Unix domain sockets, but it seems unworthy of doing so because even though setting SO_REUSEPORT on both UDP sockets and Unix domain sockets will tip the scales of event-loops, it can work. Therefore, I decided to allow UDP sockets and Unix domain sockets to co-exist and only disable SO_REUSEPORT for Unix domain sockets when there is no UDP sockets.

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

Successfully merging a pull request may close this issue.

1 participant