-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
net: add tos and set_tos methods to TCP and UDP sockets #4366
Conversation
tokio/src/net/tcp/socket.rs
Outdated
#[cfg(not(any( | ||
target_os = "fuchsia", | ||
target_os = "redox", | ||
target_os = "solaris", | ||
target_os = "illumos", | ||
)))] | ||
#[cfg_attr( | ||
docsrs, | ||
doc(cfg(all( | ||
unix, | ||
not(any( | ||
target_os = "fuchsia", | ||
target_os = "redox", | ||
target_os = "solaris", | ||
target_os = "illumos", | ||
)) | ||
))) | ||
)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of these includes a all(unix, ...)
and the other doesn't. Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. I forgot to remove all(unix, ...)
when I copied the doc cfg from TcpSocket::reuseport
.
tokio/src/net/udp.rs
Outdated
fn to_socket(&self) -> socket2::SockRef<'_> { | ||
socket2::SockRef::from(self) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like I commented on the other PR, it is more idiomatic to call it as_socket
.
fn to_socket(&self) -> socket2::SockRef<'_> { | |
socket2::SockRef::from(self) | |
} | |
fn as_socket(&self) -> socket2::SockRef<'_> { | |
socket2::SockRef::from(self) | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in fdd5865
Closes #3545
cc #3082
The first commit is from #4361.
Refs: