-
Notifications
You must be signed in to change notification settings - Fork 50
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
Support ephemeral port assignments on bind #110
Conversation
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.
Thanks for doing this!
src/net/tcp/listener.rs
Outdated
/// | ||
/// Only 0.0.0.0 is currently supported. | ||
/// When the port is unspecified (0), an ephemeral port number is generated. |
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.
/// | |
/// Only 0.0.0.0 is currently supported. | |
/// When the port is unspecified (0), an ephemeral port number is generated. | |
/// Binding with a port number of 0 will request that the OS assigns a port | |
/// to this listener. The port allocated can be queried via the `local_addr` | |
/// method. | |
/// | |
/// Only 0.0.0.0 is currently supported. |
src/net/udp.rs
Outdated
@@ -94,6 +94,7 @@ impl UdpSocket { | |||
/// provided. | |||
/// | |||
/// Only 0.0.0.0 is currently supported. | |||
/// When the port is unspecified (0), an ephemeral port number is generated. |
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.
Let's update this one to public docs as well:
/// This function will create a new UDP socket and attempt to bind it to
/// the `addr` provided.
///
/// Binding with a port number of 0 will request that the OS assigns a port
/// to this listener. The port allocated can be queried via the `local_addr`
/// method.
#104