connect(2) wrapper. Equivalent to connect(m_socket, addr, addrlen). Code that uses this wrapper can be unit tested if this method is overridden by a mock Sock implementation.

Synopsis

Declared in <util/sock.h>

[[nodiscard]]
virtual
int
Connect(
    sockaddr const* addr,
    socklen_t addr_len) const;

Return Value

0 on success, or ‐1 on error (with errno set).

Note

The return value should not be discarded.

Parameters

Name

Description

addr

Address to connect to.

addr_len

Size in bytes of the address pointed to by addr.

Created with MrDocs