uvcc
libuv C++ bindings
Network-related structures initialization

sockaddr_in

int uv::init (::sockaddr_in &_sin)
 Initialize a sockaddr_in structure.
 
int uv::init (::sockaddr_in &_sin, const char *_ip, const char *_port=nullptr)
 Initialize a sockaddr_in structure from strings containing an IPv4 address and (optionally) a port. More...
 

sockaddr_in6

int uv::init (::sockaddr_in6 &_sin6)
 Initialize a sockaddr_in6 structure.
 
int uv::init (::sockaddr_in6 &_sin6, const char *_ip, const char *_port=nullptr)
 Initialize a sockaddr_in6 structure from strings containing an IPv6 address and (optionally) a port. More...
 

sockaddr_storage

int uv::init (::sockaddr_storage &_ss, decltype(::sockaddr::sa_family) _family=AF_UNSPEC)
 
int uv::init (::sockaddr_storage &_ss, const ::sockaddr &_sa)
 
int uv::init (::sockaddr_storage &_ss, const char *_ip, const char *_port=nullptr)
 

addrinfo

int uv::init (::addrinfo &_ai, decltype(::addrinfo::ai_family) _family=AF_UNSPEC, decltype(::addrinfo::ai_socktype) _socktype=0, decltype(::addrinfo::ai_flags) _flags=AI_ADDRCONFIG)
 Initialize an addrinfo structure for to be used as a hints argument in uv::getaddrinfo request. More...
 

Detailed Description

See also
Linux: ip(7):sockaddr_in, ipv6(7):sockaddr_in6, socket(7):sockaddr_storage.
Windows: sockaddr_in, sockaddr_in6, sockaddr_storage.

Function Documentation

◆ init() [1/3]

int uv::init ( ::sockaddr_in &  _sin,
const char *  _ip,
const char *  _port = nullptr 
)
inline

Initialize a sockaddr_in structure from strings containing an IPv4 address and (optionally) a port.

See also
libuv API documentation: uv_ip4_addr(), uv_inet_pton().
Linux: inet_pton().
Windows: RtlIpv4StringToAddressEx(), InetPton().

Definition at line 47 of file netstruct.hpp.

◆ init() [2/3]

int uv::init ( ::sockaddr_in6 &  _sin6,
const char *  _ip,
const char *  _port = nullptr 
)
inline

Initialize a sockaddr_in6 structure from strings containing an IPv6 address and (optionally) a port.

See also
libuv API documentation: uv_ip6_addr(), uv_inet_pton().
Linux: inet_pton().
Windows: RtlIpv6StringToAddressEx(), InetPton().

Definition at line 72 of file netstruct.hpp.

◆ init() [3/3]

int uv::init ( ::addrinfo &  _ai,
decltype(::addrinfo::ai_family)  _family = AF_UNSPEC,
decltype(::addrinfo::ai_socktype)  _socktype = 0,
decltype(::addrinfo::ai_flags)  _flags = AI_ADDRCONFIG 
)
inline

Initialize an addrinfo structure for to be used as a hints argument in uv::getaddrinfo request.

The _family argument might be AF_UNSPEC or AF_INET or AF_INET6 or (Windows only) AF_NETBIOS.

The _socktype argument might be SOCK_DGRAM or SOCK_STREAM.

The _flags argument can be a combination of the following values:

  • AI_ADDRCONFIG
  • AI_ALL
  • AI_CANONNAME
  • AI_NUMERICHOST
  • AI_NUMERICSERV
  • AI_PASSIVE
  • AI_V4MAPPED

Linux only - extensions for Internationalized Domain Names:

  • AI_CANONIDN
  • AI_IDN
  • AI_IDN_ALLOW_UNASSIGNED
  • AI_IDN_USE_STD3_ASCII_RULES

Windows only:

  • AI_DISABLE_IDN_ENCODING
  • AI_FILESERVER
  • AI_FLAGS
  • AI_FQDN
  • AI_NON_AUTHORITATIVE
  • AI_RETURN_PREFERRED_NAMES
  • AI_SECURE
See also
Linux: getaddrinfo().
Windows: addrinfo, getaddrinfo(), GetAddrInfoEx().

Definition at line 158 of file netstruct.hpp.