-
Notifications
You must be signed in to change notification settings - Fork 0
fix: ensure tcp keep-alive packets are sent #19
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
base: main
Are you sure you want to change the base?
Conversation
| if let Some(stream) = stream { | ||
| #[cfg(target_os = "linux")] | ||
| unsafe { | ||
| libc::setsockopt( |
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.
check the result?
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.
Also is there are any safety assumptions?
Should keep_alive_interval always be > 0?
Or be specific type?
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.
extracted the logic into separate function:
if keepalive setting is zero, then we assume no keepalive
174488c to
961a4d5
Compare
on some systems tcp keep-alive must be enabled per-connection