Initiates an asynchronous connection to the given address.

Synopsis

Declared in <folly/io/async/AsyncSocketTransport.h>

virtual
void
connect(
    ConnectCallback* callback,
    folly::SocketAddress const& address,
    int timeout = 0,
    SocketOptionMap const& options = emptySocketOptionMap,
    BindOptions const& bindOptions = anyAddress(),
    std::string const& ifName = "") noexcept = 0;

Parameters

Name

Description

callback

The callback invoked when the connection succeeds or fails.

address

The remote address to connect to.

timeout

The connection timeout in milliseconds, or zero for none.

options

Socket options to apply before connecting.

bindOptions

Local bind options or a pre‐bound socket to use.

ifName

The name of the network interface to bind to, if any.

Created with MrDocs