Go to the latest version of this document.

# ``twisted`.`internet`.`endpoints`.`_SimpleHostnameResolver``

class documentation

`class _SimpleHostnameResolver: (source)`

Constructor: `_SimpleHostnameResolver(nameResolution)`

Implements interfaces: `twisted.internet.interfaces.IHostnameResolver`

View In Hierarchy

An `IHostnameResolver` provider that invokes a provided callable to resolve hostnames.

Method | `__init__` | Create a `_SimpleHostnameResolver` instance.
Method | `resolveHostName` | Initiate a hostname resolution.
Class Variable | `_log` | Undocumented
Instance Variable | `_nameResolution` | the callable `resolveHostName` invokes to resolve hostnames.

def __init__(self, nameResolution: `Callable[[str, int], Deferred[_gairesult]]`): (source)

Create a `_SimpleHostnameResolver` instance.

def resolveHostName(self, resolutionReceiver: `IResolutionReceiver`, hostName: `str`, portNumber: `int` = 0, addressTypes: `Sequence[type[IAddress]] | None` = None, transportSemantics: `str` = 'TCP') -> `IHostResolution`: (source)
from `twisted.internet.interfaces.IHostnameResolver`

Initiate a hostname resolution.

Parameters
resolutionReceiver:`IResolutionReceiver` | an object that will receive each resolved address as it arrives.
hostName:`str` | see interface
portNumber:`int` | see interface
addressTypes:`Sequence[type[IAddress]] | None` | Ignored in this implementation.
transportSemantics:`str` | Ignored in this implementation.

Returns
`IResolutionReceiver` | The resolution in progress.

_log = (source)

Undocumented

_nameResolution: A `callable` that accepts two arguments: the host to resolve and the port number to include in the result. = (source)

the callable `resolveHostName` invokes to resolve hostnames.