I would like to use tokio::net::TcpStream as an asynchronous TCP listener. On the other hand, I also want to use set_reuse_address, set_reuse_port, and set_nonblocking in socket2::Socket.
How can I convert from socket2::Socket to tokio::net::TcpStream?
I would like to use tokio::net:TcpStream to listen for efficient and non-blocking TCP connections using asynchronous callbacks.
If you find that such a thing is not possible in the first place or that my understanding of asynchronous is incorrect, I would be grateful if you could point out anything. thank you.
Yes, you can convert both from/to
std::net::TcpStreamso you can go through that as common exchange format.