Skip to content

Commit 55f5a1e

Browse files
committed
Add recvfrom and sendto.
We leave them for compatibility, but mark them as deprecated. Signed-off-by: OGINO Masanori <[email protected]>
1 parent dfdce47 commit 55f5a1e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/libstd/io/net/udp.rs

+13
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,13 @@ impl UdpSocket {
8282
}
8383
}
8484

85+
#[allow(missing_doc)]
86+
#[deprecated = "renamed to `recv_from`"]
87+
pub fn recvfrom(&mut self, buf: &mut [u8])
88+
-> IoResult<(uint, SocketAddr)> {
89+
self.recv_from(buf)
90+
}
91+
8592
/// Sends data on the socket to the given address. Returns nothing on
8693
/// success.
8794
pub fn send_to(&mut self, buf: &[u8], dst: SocketAddr) -> IoResult<()> {
@@ -91,6 +98,12 @@ impl UdpSocket {
9198
}).map_err(IoError::from_rtio_error)
9299
}
93100

101+
#[allow(missing_doc)]
102+
#[deprecated = "renamed to `send_to`"]
103+
pub fn sendto(&mut self, buf: &[u8], dst: SocketAddr) -> IoResult<()> {
104+
self.send_to(buf, dst)
105+
}
106+
94107
/// Creates a `UdpStream`, which allows use of the `Reader` and `Writer`
95108
/// traits to receive and send data from the same address. This transfers
96109
/// ownership of the socket to the stream.

0 commit comments

Comments
 (0)