Skip to content

Commit

Permalink
Support Socket::(set_)recv_tos on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomasdezeeuw committed Apr 29, 2022
1 parent aeb6c2d commit 242e087
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions src/socket.rs
Expand Up @@ -1400,7 +1400,6 @@ impl Socket {
target_os = "netbsd",
target_os = "redox",
target_os = "solaris",
target_os = "windows",
)))]
pub fn set_recv_tos(&self, recv_tos: bool) -> io::Result<()> {
let recv_tos = if recv_tos { 1 } else { 0 };
Expand All @@ -1426,7 +1425,6 @@ impl Socket {
target_os = "netbsd",
target_os = "redox",
target_os = "solaris",
target_os = "windows",
)))]
pub fn recv_tos(&self) -> io::Result<bool> {
unsafe {
Expand Down
6 changes: 3 additions & 3 deletions src/sys/windows.rs
Expand Up @@ -69,9 +69,9 @@ pub(crate) use windows_sys::Win32::Networking::WinSock::{
IPV6_MULTICAST_HOPS, IPV6_MULTICAST_IF, IPV6_MULTICAST_LOOP, IPV6_UNICAST_HOPS, IPV6_V6ONLY,
IP_ADD_MEMBERSHIP, IP_ADD_SOURCE_MEMBERSHIP, IP_DROP_MEMBERSHIP, IP_DROP_SOURCE_MEMBERSHIP,
IP_MREQ as IpMreq, IP_MREQ_SOURCE as IpMreqSource, IP_MULTICAST_IF, IP_MULTICAST_LOOP,
IP_MULTICAST_TTL, IP_TOS, IP_TTL, MSG_OOB, MSG_PEEK, SO_BROADCAST, SO_ERROR, SO_KEEPALIVE,
SO_LINGER, SO_OOBINLINE, SO_RCVBUF, SO_RCVTIMEO, SO_REUSEADDR, SO_SNDBUF, SO_SNDTIMEO, SO_TYPE,
TCP_NODELAY,
IP_MULTICAST_TTL, IP_RECVTOS, IP_TOS, IP_TTL, MSG_OOB, MSG_PEEK, SO_BROADCAST, SO_ERROR,
SO_KEEPALIVE, SO_LINGER, SO_OOBINLINE, SO_RCVBUF, SO_RCVTIMEO, SO_REUSEADDR, SO_SNDBUF,
SO_SNDTIMEO, SO_TYPE, TCP_NODELAY,
};
pub(crate) const IPPROTO_IP: c_int = windows_sys::Win32::Networking::WinSock::IPPROTO_IP as c_int;
pub(crate) const SOL_SOCKET: c_int = windows_sys::Win32::Networking::WinSock::SOL_SOCKET as c_int;
Expand Down

0 comments on commit 242e087

Please sign in to comment.