Skip to content

Commit 68a18c4

Browse files
committed
clarify documentation of TcpStream::connect() for multiple valid addresses
Signed-off-by: benaryorg <[email protected]>
1 parent f01bb5e commit 68a18c4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/libstd/net/tcp.rs

+2
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ impl TcpStream {
8686
/// `addr` is an address of the remote host. Anything which implements
8787
/// `ToSocketAddrs` trait can be supplied for the address; see this trait
8888
/// documentation for concrete examples.
89+
/// In case `ToSocketAddrs::to_socket_addrs()` returns more than one entry,
90+
/// then the first valid and reachable address is used.
8991
#[stable(feature = "rust1", since = "1.0.0")]
9092
pub fn connect<A: ToSocketAddrs>(addr: A) -> io::Result<TcpStream> {
9193
super::each_addr(addr, net_imp::TcpStream::connect).map(TcpStream)

0 commit comments

Comments
 (0)