Skip to content

Commit

Permalink
Deprecate UdpStream
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian Orth committed Oct 25, 2014
1 parent 8adfd02 commit d6dc01e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/libstd/io/net/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ impl UdpSocket {
///
/// Note that this call does not perform any actual network communication,
/// because UDP is a datagram protocol.
#[deprecated = "`UdpStream` has been deprecated"]
#[allow(deprecated)]
pub fn connect(self, other: SocketAddr) -> UdpStream {
UdpStream {
socket: self,
Expand Down Expand Up @@ -205,6 +207,14 @@ impl Clone for UdpSocket {

/// A type that allows convenient usage of a UDP stream connected to one
/// address via the `Reader` and `Writer` traits.
///
/// # Note
///
/// This structure has been deprecated because `Reader` is a stream-oriented API but UDP
/// is a packet-oriented protocol. Every `Reader` method will read a whole packet and
/// throw all superfluous bytes away so that they are no longer available for further
/// method calls.
#[deprecated]
pub struct UdpStream {
socket: UdpSocket,
connected_to: SocketAddr
Expand Down Expand Up @@ -336,6 +346,7 @@ mod test {
}

#[test]
#[allow(deprecated)]
fn stream_smoke_test_ip4() {
let server_ip = next_test_ip4();
let client_ip = next_test_ip4();
Expand Down Expand Up @@ -380,6 +391,7 @@ mod test {
}

#[test]
#[allow(deprecated)]
fn stream_smoke_test_ip6() {
let server_ip = next_test_ip6();
let client_ip = next_test_ip6();
Expand Down

13 comments on commit d6dc01e

@bors
Copy link
Contributor

@bors bors commented on d6dc01e Oct 26, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from alexcrichton
at mahkoh@d6dc01e

@bors
Copy link
Contributor

@bors bors commented on d6dc01e Oct 26, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging mahkoh/rust/udp = d6dc01e into auto

@bors
Copy link
Contributor

@bors bors commented on d6dc01e Oct 26, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mahkoh/rust/udp = d6dc01e merged ok, testing candidate = 5e07d173

@bors
Copy link
Contributor

@bors bors commented on d6dc01e Oct 26, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on d6dc01e Oct 26, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from alexcrichton
at mahkoh@d6dc01e

@bors
Copy link
Contributor

@bors bors commented on d6dc01e Oct 26, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging mahkoh/rust/udp = d6dc01e into auto

@bors
Copy link
Contributor

@bors bors commented on d6dc01e Oct 26, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mahkoh/rust/udp = d6dc01e merged ok, testing candidate = abd1222d

@bors
Copy link
Contributor

@bors bors commented on d6dc01e Oct 26, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on d6dc01e Oct 27, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from alexcrichton
at mahkoh@d6dc01e

@bors
Copy link
Contributor

@bors bors commented on d6dc01e Oct 27, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging mahkoh/rust/udp = d6dc01e into auto

@bors
Copy link
Contributor

@bors bors commented on d6dc01e Oct 27, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mahkoh/rust/udp = d6dc01e merged ok, testing candidate = a93e9c2

@bors
Copy link
Contributor

@bors bors commented on d6dc01e Oct 27, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on d6dc01e Oct 27, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = a93e9c2

Please sign in to comment.