@@ -50,8 +50,8 @@ pub struct UdpSocket(net_imp::UdpSocket);
50
50
impl UdpSocket {
51
51
/// Creates a UDP socket from the given address.
52
52
///
53
- /// Address type can be any implementor of `ToSocketAddr` trait. See its
54
- /// documentation for concrete examples.
53
+ /// The address type can be any implementor of `ToSocketAddr` trait. See
54
+ /// its documentation for concrete examples.
55
55
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
56
56
pub fn bind < A : ToSocketAddrs > ( addr : A ) -> io:: Result < UdpSocket > {
57
57
super :: each_addr ( addr, net_imp:: UdpSocket :: bind) . map ( UdpSocket )
@@ -64,8 +64,8 @@ impl UdpSocket {
64
64
self . 0 . recv_from ( buf)
65
65
}
66
66
67
- /// Sends data on the socket to the given address. Returns nothing on
68
- /// success .
67
+ /// Sends data on the socket to the given address. On success, returns the
68
+ /// number of bytes written .
69
69
///
70
70
/// Address type can be any implementor of `ToSocketAddrs` trait. See its
71
71
/// documentation for concrete examples.
@@ -95,34 +95,34 @@ impl UdpSocket {
95
95
self . 0 . duplicate ( ) . map ( UdpSocket )
96
96
}
97
97
98
- /// Sets the broadcast flag on or off
98
+ /// Sets the broadcast flag on or off.
99
99
pub fn set_broadcast ( & self , on : bool ) -> io:: Result < ( ) > {
100
100
self . 0 . set_broadcast ( on)
101
101
}
102
102
103
- /// Sets the multicast loop flag to the specified value
103
+ /// Sets the multicast loop flag to the specified value.
104
104
///
105
105
/// This lets multicast packets loop back to local sockets (if enabled)
106
106
pub fn set_multicast_loop ( & self , on : bool ) -> io:: Result < ( ) > {
107
107
self . 0 . set_multicast_loop ( on)
108
108
}
109
109
110
- /// Joins a multicast IP address (becomes a member of it)
110
+ /// Joins a multicast IP address (becomes a member of it).
111
111
pub fn join_multicast ( & self , multi : & IpAddr ) -> io:: Result < ( ) > {
112
112
self . 0 . join_multicast ( multi)
113
113
}
114
114
115
- /// Leaves a multicast IP address (drops membership from it)
115
+ /// Leaves a multicast IP address (drops membership from it).
116
116
pub fn leave_multicast ( & self , multi : & IpAddr ) -> io:: Result < ( ) > {
117
117
self . 0 . leave_multicast ( multi)
118
118
}
119
119
120
- /// Sets the multicast TTL
120
+ /// Sets the multicast TTL.
121
121
pub fn set_multicast_time_to_live ( & self , ttl : i32 ) -> io:: Result < ( ) > {
122
122
self . 0 . multicast_time_to_live ( ttl)
123
123
}
124
124
125
- /// Sets this socket's TTL
125
+ /// Sets this socket's TTL.
126
126
pub fn set_time_to_live ( & self , ttl : i32 ) -> io:: Result < ( ) > {
127
127
self . 0 . time_to_live ( ttl)
128
128
}
0 commit comments