twisted.internet.endpoints.HostnameEndpoint.connect(self, protocolFactory)
method documentationtwisted.internet.endpoints.HostnameEndpoint
View Source
Attempts a connection to each resolved address, and returns a connection which is established first.
Parameters | protocolFactory | The protocol factory whose protocol will be connected. (type: IProtocolFactory ) |
Returns | A Deferred that fires with the connected protocol or fails a connection-related error. |
Class | EndpointReceiver | Undocumented |
Function | resolvedAddressesToEndpoints | Undocumented |
Function | startConnectionAttempts | No summary |
Function | _canceller | Undocumented |
Given a sequence of endpoints obtained via name resolution, start connecting to a new one every self._attemptDelay
seconds until one of the connections succeeds, all of them fail, or the attempt is cancelled.
Parameters | endpoints | a list of all the endpoints we might try to connect to, as determined by name resolution. (type: list of IStreamServerEndpoint ) |
Returns | a Deferred that fires with the result of the endpoint.connect method that completes the fastest, or fails with the first connection error it encountered if none of them succeed. (type: Deferred failing with error.ConnectingCancelledError or firing with IProtocol ) |