#include <asyncdns.h>
Public Member Functions |
| AsyncDNS () |
| ~AsyncDNS () |
void | resolve (AsyncDNSHandler *adh, const std::string &service, const std::string &proto, const std::string &domain, const LogSink &logInstance, void *context) |
void | resolve (AsyncDNSHandler *adh, const std::string &domain, const LogSink &logInstance, void *context) |
void | connect (AsyncDNSHandler *adh, const std::string &host, const LogSink &logInstance, void *context) |
void | connect (AsyncDNSHandler *adh, const std::string &host, int port, const LogSink &logInstance, void *context) |
Detailed Description
An asynchronous DNS resolver class.
- Author
- Jakob Schroeter js@ca.nosp@m.maya.nosp@m..net
- Since
- 1.1
Definition at line 37 of file asyncdns.h.
Constructor & Destructor Documentation
Member Function Documentation
This is a convenience function which uses resolve() to get a list of hosts and connects to one of them.
- Parameters
-
adh | The result handler. |
host | The host to resolve SRV records for. |
logInstance | A LogSink to use for logging. |
context | User-supplied context information. |
Definition at line 173 of file asyncdns.cpp.
void connect |
( |
AsyncDNSHandler * |
adh, |
|
|
const std::string & |
host, |
|
|
int |
port, |
|
|
const LogSink & |
logInstance, |
|
|
void * |
context |
|
) |
| |
This is a convenience function which connects to the given host and port. No SRV records are resolved. Use this function for special setups.
- Parameters
-
adh | The result handler. |
host | The host/IP address to connect to. |
port | A custom port to connect to. |
logInstance | A LogSink to use for logging. |
context | User-supplied context information. |
Definition at line 188 of file asyncdns.cpp.
void handleAsyncConnectResult |
( |
int |
fd, |
|
|
void * |
context |
|
) |
| |
|
protectedvirtual |
- Parameters
-
fd | A file descriptor for the established connection. |
context | User-defined context information. |
Implements AsyncDNSHandler.
Definition at line 225 of file asyncdns.cpp.
void handleAsyncResolveResult |
( |
const DNS::HostMap & |
hosts, |
|
|
void * |
context |
|
) |
| |
|
protectedvirtual |
- Parameters
-
hosts | A list of weighted hostname/port pairs from SRV records, or A records if no SRV records where found. |
context | User-defined context information. |
Implements AsyncDNSHandler.
Definition at line 203 of file asyncdns.cpp.
void resolve |
( |
AsyncDNSHandler * |
adh, |
|
|
const std::string & |
service, |
|
|
const std::string & |
proto, |
|
|
const std::string & |
domain, |
|
|
const LogSink & |
logInstance, |
|
|
void * |
context |
|
) |
| |
This function asynchronously resolves a service/protocol/domain tuple.
- Parameters
-
adh | The result handler. |
service | The SRV service type. |
proto | The SRV protocol. |
domain | The domain to search for SRV records. |
logInstance | A LogSink to use for logging. |
context | User-supplied context information. |
Definition at line 158 of file asyncdns.cpp.
void resolve |
( |
AsyncDNSHandler * |
adh, |
|
|
const std::string & |
domain, |
|
|
const LogSink & |
logInstance, |
|
|
void * |
context |
|
) |
| |
|
inline |
This is a convenience funtion which uses resolve() to resolve SRV records asynchronously for a given domain, using a service of xmpp-client and a proto of tcp.
- Parameters
-
adh | The result handler. |
domain | The domain to resolve SRV records for. |
logInstance | A LogSink to use for logging. |
context | User-supplied context information. |
Definition at line 70 of file asyncdns.h.
The documentation for this class was generated from the following files: