ark::net::inet6_address class

denotes an IPV6 network address

Base classes

template<class SockAddr, clinux::sa_family_t AddrFamily>
class address_with_family<clinux::sockaddr_in6, AF_INET6>
Provides common members and types for network address of specific address family.

Public static functions

static auto from_address(address addr) -> result<inet6_address> noexcept
downcast from an address

Public functions

auto host() const -> result<string> noexcept
returns the string representation of the host
auto host(string host_s) -> result<void> noexcept
sets the host
auto port() const -> unsigned short noexcept
gets the port
void port(unsigned short p) noexcept
sets the port
auto to_string() const -> result<string> noexcept
convert address to string

Function documentation

static result<inet6_address> ark::net::inet6_address::from_address(address addr) noexcept

downcast from an address

error if the address family does not match

result<string> ark::net::inet6_address::host() const noexcept

returns the string representation of the host

error if the host is invalid

result<void> ark::net::inet6_address::host(string host_s) noexcept

sets the host

Parameters
host_s in ipv6 string representation, like '::1'

error if the given string is invalid

result<string> ark::net::inet6_address::to_string() const noexcept

convert address to string

format is '[host]:port', like '[::1]:8080'

error if the address is invalid