Skip to content

Commit 242e087

Browse files
committed
Support Socket::(set_)recv_tos on Windows
1 parent aeb6c2d commit 242e087

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/socket.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,7 +1400,6 @@ impl Socket {
14001400
target_os = "netbsd",
14011401
target_os = "redox",
14021402
target_os = "solaris",
1403-
target_os = "windows",
14041403
)))]
14051404
pub fn set_recv_tos(&self, recv_tos: bool) -> io::Result<()> {
14061405
let recv_tos = if recv_tos { 1 } else { 0 };
@@ -1426,7 +1425,6 @@ impl Socket {
14261425
target_os = "netbsd",
14271426
target_os = "redox",
14281427
target_os = "solaris",
1429-
target_os = "windows",
14301428
)))]
14311429
pub fn recv_tos(&self) -> io::Result<bool> {
14321430
unsafe {

src/sys/windows.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ pub(crate) use windows_sys::Win32::Networking::WinSock::{
6969
IPV6_MULTICAST_HOPS, IPV6_MULTICAST_IF, IPV6_MULTICAST_LOOP, IPV6_UNICAST_HOPS, IPV6_V6ONLY,
7070
IP_ADD_MEMBERSHIP, IP_ADD_SOURCE_MEMBERSHIP, IP_DROP_MEMBERSHIP, IP_DROP_SOURCE_MEMBERSHIP,
7171
IP_MREQ as IpMreq, IP_MREQ_SOURCE as IpMreqSource, IP_MULTICAST_IF, IP_MULTICAST_LOOP,
72-
IP_MULTICAST_TTL, IP_TOS, IP_TTL, MSG_OOB, MSG_PEEK, SO_BROADCAST, SO_ERROR, SO_KEEPALIVE,
73-
SO_LINGER, SO_OOBINLINE, SO_RCVBUF, SO_RCVTIMEO, SO_REUSEADDR, SO_SNDBUF, SO_SNDTIMEO, SO_TYPE,
74-
TCP_NODELAY,
72+
IP_MULTICAST_TTL, IP_RECVTOS, IP_TOS, IP_TTL, MSG_OOB, MSG_PEEK, SO_BROADCAST, SO_ERROR,
73+
SO_KEEPALIVE, SO_LINGER, SO_OOBINLINE, SO_RCVBUF, SO_RCVTIMEO, SO_REUSEADDR, SO_SNDBUF,
74+
SO_SNDTIMEO, SO_TYPE, TCP_NODELAY,
7575
};
7676
pub(crate) const IPPROTO_IP: c_int = windows_sys::Win32::Networking::WinSock::IPPROTO_IP as c_int;
7777
pub(crate) const SOL_SOCKET: c_int = windows_sys::Win32::Networking::WinSock::SOL_SOCKET as c_int;

0 commit comments

Comments
 (0)