Is it possible to close a TcpListener in Tokio?
问题 I have a tokio_core::net::TcpListener that I create and then call the incoming method on to get a stream of incoming connections. I then use the for_each method on that stream to turn it into a future and run the future on an event loop. Once I do that is there any way to unbind from the port at some later time? If not, is there any other API in Tokio that can be used to create a TCP server which can be closed? 回答1: In short, you need to drop the TcpListener / the Future returned by for_each