'Deliver connection failures to any L{ClientService.whenConnected}
L{Deferred}s that have met their failAfterFailures threshold.
@param f: the Failure to fire the L{Deferred}s with.'

@_machine.output()
def _deliverConnectionFailure(self, f):

    ready = []
    notReady = []
    for (w, remaining) in self._awaitingConnected:
        if (remaining is None):
            notReady.append((w, remaining))
        elif (remaining <= 1):
            ready.append(w)
        else:
            notReady.append((w, (remaining - 1)))
    self._awaitingConnected = notReady
    for w in ready:
        w.callback(f)
