net: document that port 0 picks a random port (#4386)

This commit is contained in:
Trey Smith
2022-01-08 13:21:11 +01:00
committed by GitHub
parent cb9a68eb1a
commit 553cc3b194
+4
View File
@@ -128,6 +128,10 @@ impl UdpSocket {
/// 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.
///
/// # Example
///
/// ```no_run