Skip to content
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

Reimplementing set_keepalive for tokio::net::TcpStream #3109

Closed
RipleyTom opened this issue Nov 7, 2020 · 3 comments
Closed

Reimplementing set_keepalive for tokio::net::TcpStream #3109

RipleyTom opened this issue Nov 7, 2020 · 3 comments
Labels
A-tokio Area: The main tokio crate C-feature-request Category: A feature request. M-net Module: tokio/net

Comments

@RipleyTom
Copy link

Is your feature request related to a problem? Please describe.
set_keepalive seems to have been dropped from tokio::net::TcpStream going from tokio 0.2 to tokio 0.3.

Describe the solution you'd like
Reimplement set_keepalive.

Describe alternatives you've considered
Getting the rawsocket and setting the socket option manually but this require a different option on windows and unix which is not ideal.

Additional context
Keepalive is an important socket option for servers that don't see regular traffic but answer queries. Without it sockets can stay alive forever. It also produces very light traffic(way less than actually having a ping/pong in the protocol on the connection).

@RipleyTom RipleyTom added A-tokio Area: The main tokio crate C-feature-request Category: A feature request. labels Nov 7, 2020
@Darksonn Darksonn added M-net Module: tokio/net C-feature-accepted Category: A feature request that has been accepted pending implementation. E-help-wanted Call for participation: Help is requested to fix this issue. and removed E-help-wanted Call for participation: Help is requested to fix this issue. labels Nov 8, 2020
@Darksonn
Copy link
Contributor

Darksonn commented Nov 8, 2020

This is blocked on tokio-rs/mio#1385.

@hawkw
Copy link
Member

hawkw commented Nov 9, 2020

See also #3082.

@carllerche
Copy link
Member

Closing as dup of #3082

@Darksonn Darksonn removed the C-feature-accepted Category: A feature request that has been accepted pending implementation. label Feb 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate C-feature-request Category: A feature request. M-net Module: tokio/net
Projects
None yet
Development

No branches or pull requests

4 participants