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

Port/Address re-use #2011

Open
Frank-Friemel opened this issue Dec 24, 2024 · 1 comment
Open

Port/Address re-use #2011

Frank-Friemel opened this issue Dec 24, 2024 · 1 comment
Labels

Comments

@Frank-Friemel
Copy link

Frank-Friemel commented Dec 24, 2024

setsockopt(sock, SOL_SOCKET, SO_EXCLUSIVEADDRUSE,

Hi, I think there is a bug in the above line. This does not work. The return value is -1. I guess because you've previously enabled address re-use. Just applying SO_EXCLUSIVEADDRUSE (without SO_REUSEADDR) works.

I mean ... what is the purpose at all? In the Linux path you enable address/port re-usage. And in the Win32 path you try to disable it by acquiring the port exclusively? Currently it's enabled for both platforms, because SO_EXCLUSIVEADDRUSE fails. I stumbled over this because for my project this behaviour was kind of unexpected. My expectation was that a port can only be bound by one application/process/thread.

@yhirose yhirose added the bug label Dec 27, 2024
@yhirose
Copy link
Owner

yhirose commented Dec 27, 2024

@Frank-Friemel thank you for the report. I'll take a look at it when I am time.

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

No branches or pull requests

2 participants