Skip to content

std: Deprecate extra TcpStream/UdpSocket methods #27368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 29, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions src/libstd/net/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ impl TcpStream {
}

/// Sets the nodelay flag on this connection to the boolean specified.
#[deprecated(since = "1.3.0",
reason = "available through the `net2` crate on crates.io")]
#[unstable(feature = "tcp_extras", reason = "available externally")]
pub fn set_nodelay(&self, nodelay: bool) -> io::Result<()> {
self.0.set_nodelay(nodelay)
}
Expand All @@ -138,6 +141,9 @@ impl TcpStream {
/// If the value specified is `None`, then the keepalive flag is cleared on
/// this connection. Otherwise, the keepalive timeout will be set to the
/// specified time, in seconds.
#[unstable(feature = "tcp_extras", reason = "available externally")]
#[deprecated(since = "1.3.0",
reason = "available through the `net2` crate on crates.io")]
pub fn set_keepalive(&self, seconds: Option<u32>) -> io::Result<()> {
self.0.set_keepalive(seconds)
}
Expand Down
18 changes: 18 additions & 0 deletions src/libstd/net/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,33 +98,51 @@ impl UdpSocket {
}

/// Sets the broadcast flag on or off.
#[deprecated(since = "1.3.0",
reason = "available through the `net2` crate on crates.io")]
#[unstable(feature = "udp_extras", reason = "available externally")]
pub fn set_broadcast(&self, on: bool) -> io::Result<()> {
self.0.set_broadcast(on)
}

/// Sets the multicast loop flag to the specified value.
///
/// This lets multicast packets loop back to local sockets (if enabled)
#[deprecated(since = "1.3.0",
reason = "available through the `net2` crate on crates.io")]
#[unstable(feature = "udp_extras", reason = "available externally")]
pub fn set_multicast_loop(&self, on: bool) -> io::Result<()> {
self.0.set_multicast_loop(on)
}

/// Joins a multicast IP address (becomes a member of it).
#[deprecated(since = "1.3.0",
reason = "available through the `net2` crate on crates.io")]
#[unstable(feature = "udp_extras", reason = "available externally")]
pub fn join_multicast(&self, multi: &IpAddr) -> io::Result<()> {
self.0.join_multicast(multi)
}

/// Leaves a multicast IP address (drops membership from it).
#[deprecated(since = "1.3.0",
reason = "available through the `net2` crate on crates.io")]
#[unstable(feature = "udp_extras", reason = "available externally")]
pub fn leave_multicast(&self, multi: &IpAddr) -> io::Result<()> {
self.0.leave_multicast(multi)
}

/// Sets the multicast TTL.
#[deprecated(since = "1.3.0",
reason = "available through the `net2` crate on crates.io")]
#[unstable(feature = "udp_extras", reason = "available externally")]
pub fn set_multicast_time_to_live(&self, ttl: i32) -> io::Result<()> {
self.0.multicast_time_to_live(ttl)
}

/// Sets this socket's TTL.
#[deprecated(since = "1.3.0",
reason = "available through the `net2` crate on crates.io")]
#[unstable(feature = "udp_extras", reason = "available externally")]
pub fn set_time_to_live(&self, ttl: i32) -> io::Result<()> {
self.0.time_to_live(ttl)
}
Expand Down