Skip to content
Closed
Changes from 2 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
adfebed
Explicitly run perl for OpenSSL Configure
smaeul Aug 28, 2017
1ffc3dd
Attempt to fix the component manifest problem for rls-preview
Sep 5, 2017
55f9087
rustdoc: Don't counts ids twice when using --enable-commonmark
ollie27 Sep 6, 2017
b4d0f61
Clarify the behavior of UDP sockets wrt. multiple addresses in `connect`
tbu- Sep 7, 2017
cd1bf6d
Added short examples for 'str::from_utf8_mut'
smt923 Sep 10, 2017
51bbd69
Fix incorrect markdown title
smt923 Sep 10, 2017
f20b030
Fix trailing whitespace
smt923 Sep 10, 2017
bc1a4c6
Add doc example to String::as_mut_str
tommyip Sep 9, 2017
303b7c2
Fix markdown link for Utf8Error
smt923 Sep 10, 2017
204414b
Actually fix the trailing whitespace
smt923 Sep 10, 2017
01e9712
Remove the `cstore` reference from Session in order to prepare encaps…
michaelwoerister Sep 5, 2017
224d47d
rustc: Make `CrateStore` private to `TyCtxt`
alexcrichton Sep 7, 2017
69b9494
Alphabetize current label explanations
carols10cents Sep 10, 2017
28fc93f
Add explanations for undocumented labels
carols10cents Sep 10, 2017
31023b0
Rollup merge of #44131 - smaeul:openssl-perl, r=Mark-Simulacrum
frewsxcv Sep 11, 2017
86402ad
Rollup merge of #44356 - nrc:rls-component-manifest, r=@alexcrichton
frewsxcv Sep 11, 2017
b6cc030
Rollup merge of #44368 - ollie27:rustdoc_pulldown_ids, r=QuietMisdreavus
frewsxcv Sep 11, 2017
322a731
Rollup merge of #44388 - tbu-:pr_doc_udp_connect_multiple, r=frewsxcv
frewsxcv Sep 11, 2017
310d771
Rollup merge of #44420 - alexcrichton:private-cstore, r=michaelwoerister
frewsxcv Sep 11, 2017
41b0761
Rollup merge of #44453 - tommyip:doc_string_as_mut_str, r=frewsxcv
frewsxcv Sep 11, 2017
b56ff00
Rollup merge of #44472 - smt923:master, r=frewsxcv
frewsxcv Sep 11, 2017
ab0a295
Rollup merge of #44476 - integer32llc:update-label-explanation, r=Mar…
frewsxcv Sep 11, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 9 additions & 16 deletions src/libstd/net/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -586,8 +586,11 @@ impl UdpSocket {
/// receive data from the specified address.
///
/// If `addr` yields multiple addresses, `connect` will be attempted with
/// each of the addresses until a connection is successful. If none of
/// the addresses are able to be connected, the error returned from the
/// each of the addresses until the underlying OS function returns no
/// error. Note that usually, a successful `connect` call does not specify
/// that there is a remote server listening on the port, rather, such an
/// error would only be detected after the first send. If the OS returns an
/// error for each of the specified addresses, the error returned from the
/// last connection attempt (the last address) is returned.
///
/// # Examples
Expand All @@ -602,20 +605,10 @@ impl UdpSocket {
/// socket.connect("127.0.0.1:8080").expect("connect function failed");
/// ```
///
/// Create a UDP socket bound to `127.0.0.1:3400` and connect the socket to
/// `127.0.0.1:8080`. If that connection fails, then the UDP socket will
/// connect to `127.0.0.1:8081`:
///
/// ```no_run
/// use std::net::{SocketAddr, UdpSocket};
///
/// let socket = UdpSocket::bind("127.0.0.1:3400").expect("couldn't bind to address");
/// let connect_addrs = [
/// SocketAddr::from(([127, 0, 0, 1], 8080)),
/// SocketAddr::from(([127, 0, 0, 1], 8081)),
/// ];
/// socket.connect(&connect_addrs[..]).expect("connect function failed");
/// ```
/// Unlike in the TCP case, passing an array of addresses to the `connect`
/// function of a UDP socket is not a useful thing to do: The OS will be
/// unable to determine whether something is listening on the remote
/// address without the application sending data.
#[stable(feature = "net2_mutators", since = "1.9.0")]
pub fn connect<A: ToSocketAddrs>(&self, addr: A) -> io::Result<()> {
super::each_addr(addr, |addr| self.0.connect(addr))
Expand Down