interface documentation

class twisted.internet.interfaces.IHostnameResolver(Interface): (source)

Known implementations: twisted.internet.endpoints._SimpleHostnameResolver

View In Hierarchy

An IHostnameResolver can resolve a host name and port number into a series of IAddress objects.

Present SinceTwisted 17.1.0
Method resolveHostName Initiate a hostname resolution.
def resolveHostName(resolutionReceiver, hostName, portNumber, addressTypes, transportSemantics): (source)

Initiate a hostname resolution.

ParametersresolutionReceiveran object that will receive each resolved address as it arrives. (type: IResolutionReceiver)
hostNameThe name of the host to resolve. If this contains non-ASCII code points, they will be converted to IDNA first. (type: str)
portNumberThe port number that the returned addresses should include. (type: int)
addressTypesAn iterable of implementors of IAddress that are acceptable values for resolutionReceiver to receive to its addressResolved. In practice, this means an iterable containing twisted.internet.address.IPv4Address, twisted.internet.address.IPv6Address, both, or neither. (type: Sequence[IAddress])
transportSemanticsA string describing the semantics of the transport; either 'TCP' for stream-oriented transports or 'UDP' for datagram-oriented; see twisted.internet.address.IPv6Address.type and twisted.internet.address.IPv4Address.type. (type: str)
ReturnsThe resolution in progress. (type: IResolutionReceiver)
API Documentation for Twisted, generated by pydoctor 20.12.1 at 2021-02-28 19:53:36.