Attempts a connection to each resolved address, and returns a connection which is established first.

ParametersprotocolFactoryThe protocol factory whose protocol will be connected. (type: IProtocolFactory)
ReturnsA 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
@d.addCallback
def resolvedAddressesToEndpoints(addresses): (source)
Undocumented
def _canceller(d): (source)
Undocumented
@d.addCallback
def startConnectionAttempts(endpoints): (source)

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.

Parametersendpointsa list of all the endpoints we might try to connect to, as determined by name resolution. (type: list of IStreamServerEndpoint)
Returnsa 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)
API Documentation for Twisted, generated by pydoctor at 2020-03-20 23:54:06.