Skip to main content

std_tcp_connect_start

Function std_tcp_connect_start 

Source
pub fn std_tcp_connect_start(
    local: SocketAddr,
    remote: SocketAddr,
    reuse_address: bool,
) -> Result<TcpStream>
Expand description

Starts a non-blocking TCP connection from local to remote: the socket is bound, and the handshake runs. A runtime waits for it to become writable, then reads take_error and peer_addr (what async-io’s own connect does), for runtimes whose connect cannot bind a local address first.

§Errors

The bind failed, or the connection failed at once.