adapnex::core::TCPConnection::Create

Creates a TCPConnection instance and connects to the specified IPv4 address and port.

Synopsis

Declared in <adapnex/core/network.h>

static
std::unique_ptr<TCPConnection>
Create(
    std::array<uint8_t, 4> ip_v4,
    uint16_t port,
    Duration timeout = 10s);

Return Value

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

Parameters

Name Description

ip_v4

The raw IPv4 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