Package pyxmpp2 :: Module interfaces :: Class Resolver
[hide private]

Class Resolver


Abstract base class for asynchronous DNS resolvers to be used with PyxMPP.
Nested Classes [hide private]
  __metaclass__
Metaclass for defining Abstract Base Classes (ABCs).
Instance Methods [hide private]
 
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__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  __abstractmethods__ = frozenset(['resolve_address', 'resolve_s...
  _abc_cache = <_weakrefset.WeakSet object at 0x86c8cac>
  _abc_negative_cache = <_weakrefset.WeakSet object at 0x86c8ccc>
  _abc_negative_cache_version = 10
  _abc_registry = <_weakrefset.WeakSet object at 0x86c8c8c>
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

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
Decorators:
  • @abstractmethod

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

 

Start looking up an A or AAAA record.

callback will be called with a list of IPv4 or IPv6 address literals 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
Decorators:
  • @abstractmethod

Class Variable Details [hide private]

__abstractmethods__

Value:
frozenset(['resolve_address', 'resolve_srv'])