Skip to content

Conversation

@0x416e746f6e
Copy link
Member

on some systems tcp keep-alive must be enabled per-connection

@0x416e746f6e 0x416e746f6e requested a review from SozinM December 1, 2025 13:50
@0x416e746f6e 0x416e746f6e self-assigned this Dec 1, 2025
if let Some(stream) = stream {
#[cfg(target_os = "linux")]
unsafe {
libc::setsockopt(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check the result?

Copy link
Contributor

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?

Copy link
Member Author

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:

https://github.com/flashbots/rproxy/pull/19/files#diff-a8e15d7f0d3d4f25cce1c3b63ee7c1603ac66e0315cdad35be4e863c5ebd400eR19-R75

if keepalive setting is zero, then we assume no keepalive

@0x416e746f6e 0x416e746f6e force-pushed the fix/ensure-tcp-keepalives branch from 174488c to 961a4d5 Compare December 3, 2025 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants