def whenConnected(self):
        if self._currentConnection is not None:
            return succeed(self._currentConnection)
        elif self._stopped:
            return fail(CancelledError())
        else:
            result = Deferred()
            self._awaitingConnected.append(result)
            return result
Retrieve the currently-connected L{Protocol}, or the next one to
dataset/ETHPy150Open twisted/twisted/twisted/application/internet.py/ClientService.whenConnected