twisted.internet.endpoints.HostnameEndpoint(object) class documentationtwisted.internet.endpoints
View Source
(View In Hierarchy)
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. |
attemptDelay is given to HostnameEndpoint.__init__.
Create a HostnameEndpoint.
| Parameters | reactor | The reactor to use for connections and delayed calls. (type: provider of IReactorTCP
and IReactorTime) |
| host | A hostname to connect to. (type: bytes) | |
| port | The port number to connect to. (type: int) | |
| timeout | For each individual connection attempt, the number of seconds to wait
before assuming the connection has failed. (type: int) | |
| bindAddress | the local address of the network interface to make the connections from. (type: bytes) | |
| attemptDelay | The number of seconds to delay between connection attempts. (type: float) | |
| See Also | twisted.internet.interfaces.IReactorTCP.connectTCP | |
Attempts a connection to each address returned by gai, and returns a connection which is established first.
Resolve the hostname string into a tuple containig the host address.