#include <dns.h>
Public Types | |
enum | DNSError { DNS_COULD_NOT_CONNECT = 1, DNS_NO_HOSTS_FOUND, DNS_COULD_NOT_RESOLVE } |
typedef std::map< std::string, int > | HostMap |
Static Public Member Functions | |
static HostMap | resolve (const std::string &service, const std::string &proto, const std::string &domain) |
static HostMap | resolve (const std::string &domain) |
static int | connect (const std::string &domain, const LogSink &logInstance) |
static int | connect (const std::string &domain, int port, const LogSink &logInstance) |
You should not need to use these functions directly.
Definition at line 54 of file dns.h.
typedef std::map<std::string, int> HostMap |
enum DNSError |
DNS::HostMap resolve | ( | const std::string & | service, | |
const std::string & | proto, | |||
const std::string & | domain | |||
) | [static] |
This funtion resolves a service/protocol/domain tuple.
service | The SRV service type. | |
proto | The SRV protocol. | |
domain | The domain to search for SRV records. |
Definition at line 80 of file dns.cpp.
Referenced by DNS::connect(), and DNS::resolve().
DNS::HostMap resolve | ( | const std::string & | domain | ) | [static] |
This is a convenience funtion which uses resolve() to resolve SRV records for a given domain, using a service of xmpp and a proto of tcp.
domain | The domain to resolve SRV records for. |
int connect | ( | const std::string & | domain, | |
const LogSink & | logInstance | |||
) | [static] |
This is a convenience function which uses resolve() to get a list of hosts and connects to one of them.
domain | The domain to resolve SRV records for. | |
logInstance | A LogSink to use for logging. |
Definition at line 169 of file dns.cpp.
Referenced by DNS::connect(), and Connection::connect().
int connect | ( | const std::string & | domain, | |
int | port, | |||
const LogSink & | logInstance | |||
) | [static] |
This is a convenience function which uses connects to the given host and port. No SRV records are resolved. Use this function for special setups.
domain | The domain to connect to. | |
port | A custom port to connect to. | |
logInstance | A LogSink to use for logging. |