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

fix: websocket fail to bind to address due to time_wait #554

Merged
merged 1 commit into from
Feb 5, 2023

Conversation

marcozzxx810
Copy link
Contributor

Related to: #515

setReuseAddr(true) is the Setter for soReuseAddr Enable/disable SO_REUSEADDR for the socket

SO_REUSEADDR allows the server to bind to an address which is in a TIME_WAIT state

https://www.javadoc.io/doc/org.java-websocket/Java-WebSocket/1.3.5/org/java_websocket/server/WebSocketServer.html

@TheButlah
Copy link
Contributor

Great, glad someone tackled this :)

Copy link
Member

@ButterscotchV ButterscotchV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems implied that this option can forcibly bind to an occupied socket. I'm unsure of the ideal behaviour for the websocket, but this should in theory resolve the linked issue.

See the documentation at https://learn.microsoft.com/en-us/windows/win32/winsock/using-so-reuseaddr-and-so-exclusiveaddruse#using-so_reuseaddr

@Eirenliel Eirenliel merged commit 687f214 into SlimeVR:main Feb 5, 2023
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 this pull request may close these issues.

4 participants