forked from denoland/deno
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ext/net): add reuseAddress option for UDP (denoland#13849)
This commit adds a `reuseAddress` option for UDP sockets. When this option is enabled, one can listen on an address even though it is already being listened on from a different process or thread. The new socket will steal the address from the existing socket. On Windows and Linux this uses the `SO_REUSEADDR` option, while on other Unixes this is done with `SO_REUSEPORT`. This behavior aligns with what libuv does. TCP sockets still unconditionally set the `SO_REUSEADDR` flag - this behavior matches Node.js and Go. This PR does not change this behaviour. Co-authored-by: Luca Casonato <hello@lcas.dev>
- Loading branch information
1 parent
38213f1
commit 873a5ce
Showing
4 changed files
with
199 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters