Skip to content

Conversation

hawkw
Copy link
Contributor

@hawkw hawkw commented Nov 18, 2020

We still need socket2 specifically for TCP keepalive, but we may just
end up removing that soon?

Signed-off-by: Eliza Weisman [email protected]

We still need `socket2` specifically for TCP keepalive, but we may just
end up removing that soon?

Signed-off-by: Eliza Weisman <[email protected]>
Comment on lines +590 to +595
if let Some(dur) = config.keep_alive_timeout {
socket
.set_keepalive(Some(dur))
.map_err(ConnectError::m("tcp set_keepalive error"))?;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@seanmonstar should I just remove keepalive from the hyper API instead? That way, we could just drop the socket2 dep entirely.

Copy link
Member

Choose a reason for hiding this comment

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

Humm.... maybe. It is a confusing property, but people do enable it to notice when a connection has died... 🤷

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah...it's looking like Tokio will probably not add support for more sophisticated configuration (e.g. keepalive retries/probe interval/etc). But it would be nice if it at least had an API for enabling/disabling keepalive and maybe setting the initial timeout before keepalive probes are sent, which should be more portable.

@seanmonstar seanmonstar merged commit abb6471 into hyperium:master Nov 18, 2020
BenxiangGe pushed a commit to BenxiangGe/hyper that referenced this pull request Jul 26, 2021
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