Reimplementing set_keepalive for tokio::net::TcpStream #3109
Labels
A-tokio
Area: The main tokio crate
C-feature-request
Category: A feature request.
M-net
Module: tokio/net
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).
The text was updated successfully, but these errors were encountered: