Skip to main content

tcp_async_io_connect

Function tcp_async_io_connect 

Source
pub(crate) async fn tcp_async_io_connect(
    addr: &SocketAddr,
    options: &TcpConnectOptions,
) -> Result<TcpStream>
Expand description

Connect a TCP socket using the async-io crate.

This in theory should be runtime-independent as async-io spawns its own thread to poll the socket. But this is inefficient on some runtimes like tokio.

Runtimes that want to connect manually should use tcp_pre_connect() to set up the socket, and then connect it manually.