Skip to main content

bind

Function bind 

Source
pub async fn bind(addr: SocketAddr) -> Result<TcpListener>
Expand description

Bind a TCP listener on addr. Pass a port of 0 to let the OS pick a free port; read it back from TcpListener::local_addr.

Exposed as a free function (rather than an associated function on the generic ControlServer) so callers do not need a turbofish to pin the handle type before they own a state value.