about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorOGINO Masanori <masanori.ogino@gmail.com>2014-07-01 08:34:18 +0900
committerOGINO Masanori <masanori.ogino@gmail.com>2014-07-02 08:21:43 +0900
commit55f5a1ef59849709a012fcd7e2f89e7ccc42b159 (patch)
treeb78937af261c14216ffa35965981bd500be8a78e /src/libstd
parentdfdce47988b7d98c617254904f8c62d1f4d83824 (diff)
downloadrust-55f5a1ef59849709a012fcd7e2f89e7ccc42b159.tar.gz
rust-55f5a1ef59849709a012fcd7e2f89e7ccc42b159.zip
Add `recvfrom` and `sendto`.
We leave them for compatibility, but mark them as deprecated.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/io/net/udp.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libstd/io/net/udp.rs b/src/libstd/io/net/udp.rs
index 7c452d6284c..cd78898d46b 100644
--- a/src/libstd/io/net/udp.rs
+++ b/src/libstd/io/net/udp.rs
@@ -82,6 +82,13 @@ impl UdpSocket {
         }
     }
 
+    #[allow(missing_doc)]
+    #[deprecated = "renamed to `recv_from`"]
+    pub fn recvfrom(&mut self, buf: &mut [u8])
+                    -> IoResult<(uint, SocketAddr)> {
+        self.recv_from(buf)
+    }
+
     /// Sends data on the socket to the given address. Returns nothing on
     /// success.
     pub fn send_to(&mut self, buf: &[u8], dst: SocketAddr) -> IoResult<()> {
@@ -91,6 +98,12 @@ impl UdpSocket {
         }).map_err(IoError::from_rtio_error)
     }
 
+    #[allow(missing_doc)]
+    #[deprecated = "renamed to `send_to`"]
+    pub fn sendto(&mut self, buf: &[u8], dst: SocketAddr) -> IoResult<()> {
+        self.send_to(buf, dst)
+    }
+
     /// Creates a `UdpStream`, which allows use of the `Reader` and `Writer`
     /// traits to receive and send data from the same address. This transfers
     /// ownership of the socket to the stream.