Async-std: How to set TCP SO_KEEPALIVE?

Created on 3 Mar 2020  路  2Comments  路  Source: async-rs/async-std

Most helpful comment

Construct a socket using socket2 and then convert it into a std::net::TcpStream and then convert that into an async_std::net::TcpListener. Alternatively net2::TcpStreamExt provides a similar method as well

The right solution here would be if we had this method exposed directly on std::net::TcpStream, as it's fairly common to want to set this.

All 2 comments

Construct a socket using socket2 and then convert it into a std::net::TcpStream and then convert that into an async_std::net::TcpListener. Alternatively net2::TcpStreamExt provides a similar method as well

The right solution here would be if we had this method exposed directly on std::net::TcpStream, as it's fairly common to want to set this.

thanks. Agree with adding it to std. For now I'm OK with socket2..

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yoshuawuyts picture yoshuawuyts  路  8Comments

matthewrobertbell picture matthewrobertbell  路  7Comments

kornelski picture kornelski  路  5Comments

yoshuawuyts picture yoshuawuyts  路  6Comments

yoshuawuyts picture yoshuawuyts  路  3Comments