-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
TCPServer
: explain how to get an ephermal port
#11407
Conversation
Explain how to be able to receive an ephermal port ("magic number" 0)
Co-authored-by: Sijawusz Pur Rahnama <[email protected]>
@@ -18,7 +18,9 @@ require "./tcp_socket" | |||
# ``` | |||
# | |||
# Options: | |||
# - *backlog* to specify how many pending connections are allowed; | |||
# - *host* local interface to bind on, or `::` to bind on all local interfaces. | |||
# - *port* specific port to bind on, or `0` to receive an "ephemeral" (free, assigned by kernel) port. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it work the same way on BSD/Darwin and on Windows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. All supported operating systems' implementations are based on the BSD socket API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @rdp 🙏
TCPServer
: explain how to get an ephermal port
Explain how to be able to receive an ephermal port ("magic number" 0)