
Public Member Functions | |
| def | close |
| def | configurable_base |
| def | configurable_default |
| def | resolve |
Configurable asynchronous DNS resolver interface.
By default, a blocking implementation is used (which simply calls
`socket.getaddrinfo`). An alternative implementation can be
chosen with the `Resolver.configure <.Configurable.configure>`
class method::
Resolver.configure('tornado.netutil.ThreadedResolver')
The implementations of this interface included with Tornado are
* `tornado.netutil.BlockingResolver`
* `tornado.netutil.ThreadedResolver`
* `tornado.netutil.OverrideResolver`
* `tornado.platform.twisted.TwistedResolver`
* `tornado.platform.caresresolver.CaresResolver`
Definition at line 245 of file netutil.py.
| def tornado.netutil.Resolver.close | ( | self | ) |
Closes the `Resolver`, freeing any resources used. .. versionadded:: 3.1
Reimplemented in tornado.netutil.OverrideResolver, and tornado.netutil.ExecutorResolver.
Definition at line 286 of file netutil.py.
| def tornado.netutil.Resolver.configurable_base | ( | cls | ) |
Definition at line 264 of file netutil.py.
Definition at line 268 of file netutil.py.
| def tornado.netutil.Resolver.resolve | ( | self, | |
| host, | |||
| port, | |||
family = socket.AF_UNSPEC, |
|||
callback = None |
|||
| ) |
Resolves an address. The ``host`` argument is a string which may be a hostname or a literal IP address. Returns a `.Future` whose result is a list of (family, address) pairs, where address is a tuple suitable to pass to `socket.connect <socket.socket.connect>` (i.e. a ``(host, port)`` pair for IPv4; additional fields may be present for IPv6). If a ``callback`` is passed, it will be run with the result as an argument when it is complete.
Reimplemented in tornado.netutil.OverrideResolver.
Definition at line 271 of file netutil.py.