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

Class DumbBlockingResolver


Simple blocking resolver using only the standard Python library.

This doesn't support SRV lookups!

resolve_srv will raise NotImplementedError 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 - domain name to look up
  • service - service name e.g. 'xmpp-client'
  • protocol - protocol name, e.g. 'tcp'
  • callback - a function to be called with a list of received addresses
Overrides: interfaces.Resolver.resolve_srv
(inherited documentation)

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 on success. Family is socket.AF_INET or socket.AF_INET6, the address is IPv4 or IPv6 literal. 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