Function liberate::net::resolve

Function Documentation

std::set<socket_address> liberate::net::resolve(api &api, address_type type, std::string const &hostname)

Resolves network host names to IP addresses.

  • specify AT_UNSPEC if you want both IPv4 and IPv6 addresses.

  • specify AT_INET4 or AT_INET6 for only IPv4 or only IPv6 addresses respectively.

  • any other address type will yield errors.

An empty list means the name could not be resolved. Actual errors are reported as exceptions.

  • std::invalid_argument if arguments were invalid.

  • std::domain_error if the functionality is not implemented.

  • std::runtime_error if an error occurred in the underlying system call.

  • std::range_error if the underlying system call returns unexpected information.

  • std::logic_error for unspecified errors.