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..
Most helpful comment
Construct a socket using
socket2and then convert it into astd::net::TcpStreamand then convert that into anasync_std::net::TcpListener. Alternativelynet2::TcpStreamExtprovides a similar method as wellThe 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.