gloox  1.1-svn
Public Member Functions | Protected Member Functions | List of all members
AsyncDNS Class Reference

#include <asyncdns.h>

Inheritance diagram for AsyncDNS:
Inheritance graph
[legend]

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)

Protected Member Functions

virtual void handleAsyncResolveResult (const DNS::HostMap &hosts, void *context)
virtual void handleAsyncConnectResult (int fd, 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

AsyncDNS ( )

Constructor.

Definition at line 143 of file asyncdns.cpp.

~AsyncDNS ( )

Destructor.

Definition at line 147 of file asyncdns.cpp.

Member Function Documentation

void connect ( AsyncDNSHandler adh,
const std::string &  host,
const LogSink logInstance,
void *  context 
)

This is a convenience function which uses resolve() to get a list of hosts and connects to one of them.

Parameters
adhThe result handler.
hostThe host to resolve SRV records for.
logInstanceA LogSink to use for logging.
contextUser-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
adhThe result handler.
hostThe host/IP address to connect to.
portA custom port to connect to.
logInstanceA LogSink to use for logging.
contextUser-supplied context information.

Definition at line 188 of file asyncdns.cpp.

void handleAsyncConnectResult ( int  fd,
void *  context 
)
protectedvirtual
Parameters
fdA file descriptor for the established connection.
contextUser-defined context information.

Implements AsyncDNSHandler.

Definition at line 225 of file asyncdns.cpp.

void handleAsyncResolveResult ( const DNS::HostMap hosts,
void *  context 
)
protectedvirtual
Parameters
hostsA list of weighted hostname/port pairs from SRV records, or A records if no SRV records where found.
contextUser-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
adhThe result handler.
serviceThe SRV service type.
protoThe SRV protocol.
domainThe domain to search for SRV records.
logInstanceA LogSink to use for logging.
contextUser-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
adhThe result handler.
domainThe domain to resolve SRV records for.
logInstanceA LogSink to use for logging.
contextUser-supplied context information.

Definition at line 70 of file asyncdns.h.


The documentation for this class was generated from the following files: