Classes | |
class | ss::resolver_result_iterator |
Resolver result container element iterator. More... | |
class | ss::resolver_result |
Container of resolved network addresses. More... | |
class | ss::resolver |
Encapsulates name resolution services. More... |
Features of the name resolution class:
Using the name resolution class:
resolver r; r.resolve("www.example.com", "http"); resolver_result& result = r.result(); resolver_result::iterator i = result.begin(); while (i != result.end()) if (predicate(*i++)) break; int socket = socket(AF_INET, SOCK_STREAM, 0); connect(socket, i->ai_addr, i->ai_addrlen);
Interacting with the Network Addressing module:
resolver r; r.resolve("www.example.com", "http"); resolver_result& result = r.result(); ipv4_address address; for (resolver_result::iterator i = result.begin(); i != result.end(); ++i) { if (predicate(*i)) { address = *i->ai_addr; break; } }