-
-
Notifications
You must be signed in to change notification settings - Fork 416
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
Adding packet receipt timestamp collection into RecvMeta for linux #2151
base: main
Are you sure you want to change the base?
Conversation
@@ -149,6 +157,11 @@ impl UdpSocketState { | |||
)?; | |||
} | |||
} | |||
#[cfg(target_os = "linux")] | |||
{ | |||
// TODO: Should have a way to opt in to this. |
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.
Is there a drawback to having this enabled? cc @mxinden
/// | ||
/// Populated on platforms: Linux | ||
#[cfg(not(wasm_browser))] | ||
pub timestamp: Option<Duration>, |
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.
Document what this is relative to. If it's unspecified, document that.
#[cfg(target_os = "linux")] | ||
{ | ||
// TODO: Should have a way to opt in to this. | ||
set_socket_option(&*io, libc::SOL_SOCKET, libc::SO_TIMESTAMP_NEW, OPTION_ON)?; |
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.
An error here probably shouldn't be fatal.
@@ -83,6 +83,7 @@ impl<M: MsgHdr> Drop for Encoder<'_, M> { | |||
/// `cmsg` must refer to a native cmsg containing a payload of type `T` | |||
pub(crate) unsafe fn decode<T: Copy, C: CMsgHdr>(cmsg: &impl CMsgHdr) -> T { | |||
assert!(mem::align_of::<T>() <= mem::align_of::<C>()); | |||
// If you're hitting this, you might need to raise the CMSG_LEN constants |
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.
Would this be more helpful as an assert message?
No description provided.