Package pyxmpp2 :: Module resolver :: Class BlockingResolver
[hide private]

Class BlockingResolver


Blocking resolver using the DNSPython package.

Both resolve_srv and resolve_address will block until the lookup completes or fail and then call the callback immediately.

Nested Classes [hide private]

Inherited from interfaces.Resolver: __metaclass__

Instance Methods [hide private]
 
__init__(self, settings=None)
x.__init__(...) initializes x; see help(type(x)) for signature
 
resolve_srv(self, domain, service, protocol, callback)
Start looking up an SRV record for service at domain.
 
resolve_address(self, hostname, callback, allow_cname=True)
Start looking up an A or AAAA record.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  __abstractmethods__ = frozenset([])
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, settings=None)
(Constructor)

 
x.__init__(...) initializes x; see help(type(x)) for signature
Overrides: object.__init__
(inherited documentation)

resolve_srv(self, domain, service, protocol, callback)

 

Start looking up an SRV record for service at domain.

callback will be called with a properly sorted list of (hostname, port) pairs on success. The list will be empty on error and it will contain only (".", 0) when the service is explicitely disabled.

Parameters:
  • domain (unicode) - domain name to look up
  • service (unicode) - service name e.g. 'xmpp-client'
  • protocol (unicode) - protocol name, e.g. 'tcp'
  • callback (function accepting a single argument) - a function to be called with a list of received addresses
Overrides: interfaces.Resolver.resolve_srv

resolve_address(self, hostname, callback, allow_cname=True)

 

Start looking up an A or AAAA record.

callback will be called with a list of (family, address) tuples (each holiding socket.AF_* and IPv4 or IPv6 address literal) on success. The list will be empty on error.

Parameters:
  • hostname (unicode) - the host name to look up
  • callback (function accepting a single argument) - a function to be called with a list of received addresses
  • allow_cname (bool) - True if CNAMEs should be followed
Overrides: interfaces.Resolver.resolve_address