Implements interfaces: twisted.internet.interfaces.IStreamClientEndpoint

A name-based endpoint that connects to the fastest amongst the resolved host addresses.

Method __init__ Create a HostnameEndpoint.
Method connect Attempts a connection to each address returned by gai, and returns a connection which is established first.
Instance Variable _getaddrinfo A hook used for testing name resolution.
Instance Variable _deferToThread A hook used for testing deferToThread.
Class Variable _DEFAULT_ATTEMPT_DELAY The default time to use between attempts, in seconds, when no attemptDelay is given to HostnameEndpoint.__init__.
Method _nameResolution Resolve the hostname string into a tuple containig the host address.
_getaddrinfo =
A hook used for testing name resolution.
_deferToThread =
A hook used for testing deferToThread.
_DEFAULT_ATTEMPT_DELAY =
The default time to use between attempts, in seconds, when no attemptDelay is given to HostnameEndpoint.__init__.
def __init__(self, reactor, host, port, timeout=30, bindAddress=None, attemptDelay=None): (source)

Create a HostnameEndpoint.

ParametersreactorThe reactor to use for connections and delayed calls. (type: provider of IReactorTCP and IReactorTime)
hostA hostname to connect to. (type: bytes)
portThe port number to connect to. (type: int)
timeoutFor each individual connection attempt, the number of seconds to wait before assuming the connection has failed. (type: int)
bindAddressthe local address of the network interface to make the connections from. (type: bytes)
attemptDelayThe number of seconds to delay between connection attempts. (type: float)
See Alsotwisted.internet.interfaces.IReactorTCP.connectTCP
def connect(self, protocolFactory): (source)

Attempts a connection to each address returned by gai, and returns a connection which is established first.

def _nameResolution(self, host, port): (source)

Resolve the hostname string into a tuple containig the host address.

API Documentation for Twisted, generated by pydoctor at 2016-04-11 10:39:53.