diff --git a/tokio/Cargo.toml b/tokio/Cargo.toml index 5d7cf8f93..565b5867e 100644 --- a/tokio/Cargo.toml +++ b/tokio/Cargo.toml @@ -96,7 +96,7 @@ mio = { version = "1.0.1", optional = true, default-features = false } parking_lot = { version = "0.12.0", optional = true } [target.'cfg(not(target_family = "wasm"))'.dependencies] -socket2 = { version = "0.5.5", optional = true, features = ["all"] } +socket2 = { version = "0.6.0", optional = true, features = ["all"] } # Currently unstable. The API exposed by these features may be broken at any time. # Requires `--cfg tokio_unstable` to enable. @@ -142,7 +142,7 @@ async-stream = "0.3" futures-concurrency = "7.6.3" [target.'cfg(not(target_family = "wasm"))'.dev-dependencies] -socket2 = "0.5.5" +socket2 = "0.6.0" tempfile = "3.1.0" proptest = "1" diff --git a/tokio/src/net/tcp/socket.rs b/tokio/src/net/tcp/socket.rs index 669e3b4e0..f8d39e12a 100644 --- a/tokio/src/net/tcp/socket.rs +++ b/tokio/src/net/tcp/socket.rs @@ -450,7 +450,7 @@ impl TcpSocket { /// # } /// ``` pub fn set_nodelay(&self, nodelay: bool) -> io::Result<()> { - self.inner.set_nodelay(nodelay) + self.inner.set_tcp_nodelay(nodelay) } /// Gets the value of the `TCP_NODELAY` option on this socket. @@ -472,7 +472,7 @@ impl TcpSocket { /// # } /// ``` pub fn nodelay(&self) -> io::Result { - self.inner.nodelay() + self.inner.tcp_nodelay() } /// Gets the value of the `IP_TOS` option for this socket. @@ -502,7 +502,7 @@ impl TcpSocket { )))) )] pub fn tos(&self) -> io::Result { - self.inner.tos() + self.inner.tos_v4() } /// Sets the value for the `IP_TOS` option on this socket. @@ -531,7 +531,7 @@ impl TcpSocket { )))) )] pub fn set_tos(&self, tos: u32) -> io::Result<()> { - self.inner.set_tos(tos) + self.inner.set_tos_v4(tos) } /// Gets the value for the `SO_BINDTODEVICE` option on this socket diff --git a/tokio/src/net/udp.rs b/tokio/src/net/udp.rs index c6406a240..1b580d4c2 100644 --- a/tokio/src/net/udp.rs +++ b/tokio/src/net/udp.rs @@ -2028,7 +2028,7 @@ impl UdpSocket { )))) )] pub fn tos(&self) -> io::Result { - self.as_socket().tos() + self.as_socket().tos_v4() } /// Sets the value for the `IP_TOS` option on this socket. @@ -2057,7 +2057,7 @@ impl UdpSocket { )))) )] pub fn set_tos(&self, tos: u32) -> io::Result<()> { - self.as_socket().set_tos(tos) + self.as_socket().set_tos_v4(tos) } /// Gets the value for the `SO_BINDTODEVICE` option on this socket