adapnex::core::TCPConnection::Create

Creates a TCPConnection instance and connects to the specified host and port.

Synopsis

Declared in <adapnex/core/network.h>

static
std::unique_ptr<TCPConnection>
Create(
    std::string const& host,
    uint16_t port,
    Duration timeout = 10s);

Return Value

Returns a valid TCPConnection instance if the connection was successful, nullptr otherwise.

Parameters

Name Description

host

The hostname or IP address to connect to.

port

The port number to connect to.

timeout

The maximum duration to wait for the connection to be established.

Created with MrDocs