ark::net::tcp::socket class

denotes a tcp socket

will be available for io after a successful connect operation, sync or async, or if the socket is retrieved by accepting from an ark::net::tcp::acceptor

Base classes

class ark::nonseekable_fd
An io object, denotes a non lseek()-able fd as defined in kernel.

Public static functions

static auto create(bool use_ipv6 = false) -> result<socket> noexcept
constructs a socket available for connecting
static auto create(async_context& ctx, bool use_ipv6 = false) -> result<socket> noexcept
constructs a socket available for connecting

Constructors, destructors, conversion operators

socket(int fd_int) protected
constructs from int fildes

Function documentation

static result<socket> ark::net::tcp::socket::create(bool use_ipv6 = false) noexcept

constructs a socket available for connecting

Parameters
use_ipv6 in if set to true, associated connect should use ark::net::inet6_address

static result<socket> ark::net::tcp::socket::create(async_context& ctx, bool use_ipv6 = false) noexcept

constructs a socket available for connecting

Parameters
ctx in bound to this ark::async_context in addition, notice that it would also be bound for accepted sockets
use_ipv6 in if set to true, associated connect should use ark::net::inet6_address

ark::net::tcp::socket::socket(int fd_int) protected

constructs from int fildes

Parameters
fd_int in must be an fildes opened by socket(2)