According to the documentation, TcpListener
and UdpSocket
will be automatically closed when the value is dropped/out of scrope. But why is there no shutdown
method to let me manually close them?
https://doc.rust-lang.org/stable/std/net/struct.TcpListener.html
drop()
it. There isn't any reason why keeping around a handle to a closed socket should be possible.