Skip to main content

bind_exclusive

Function bind_exclusive 

Source
pub(crate) async fn bind_exclusive(addr: &str) -> Result<TcpListener>
Expand description

Bind a listener for this server’s own use of its address. Windows lets programs share an address when they ask to (SO_REUSEADDR), and a program that did could then receive connections meant for this server, the sign-in among them; with SO_EXCLUSIVEADDRUSE the address is this server’s alone and any other bind of it is refused, whatever it asks for. Elsewhere the system already refuses a second bind.