def ipc_client_connect(client_factory): """Connect the IPC client factory.""" ac = ActivationClient(get_activation_config()) port = yield ac.get_active_port() # pylint: disable=E1101 connector = reactor.connectTCP(LOCALHOST, port, client_factory) defer.returnValue(connector)
def ipc_client_connect(client_factory, reactor=None): """Connect the IPC client factory.""" ac = ActivationClient(get_activation_config()) if reactor is None: from twisted.internet import reactor description = yield ac.get_active_client_description() client = endpoints.clientFromString(reactor, description) port = yield client.connect(client_factory) defer.returnValue(port)
def client_connect(client_factory, service_name, activation_cmdline, port, reactor=None): """Connect the IPC client factory.""" config = ActivationConfig(service_name, activation_cmdline, port) ac = ActivationClient(config) port = yield ac.get_active_port() if reactor is None: from twisted.internet import reactor connector = reactor.connectTCP(LOCALHOST, port, client_factory) defer.returnValue(connector)
def client_connect(client_factory, service_name, activation_cmdline, description, reactor=None): """Connect the IPC client factory.""" config = ActivationConfig(service_name, activation_cmdline, description) ac = ActivationClient(config) description = yield ac.get_active_client_description() if reactor is None: from twisted.internet import reactor client = endpoints.clientFromString(reactor, description) port = yield client.connect(client_factory) defer.returnValue(port)
def connect(self): """Connect to the sso service.""" ac = ActivationClient(get_activation_config()) port = yield ac.get_active_port() # got the port, lets try and connect to it and get the diff # remote objects for the wrappers self.factory = PBClientFactory() # the reactor does have a connectTCP method # pylint: disable=E1101 self.client = reactor.connectTCP(LOCALHOST, port, self.factory) # pylint: enable=E1101 root = yield self.factory.getRootObject() client = yield self._request_remote_objects(root) defer.returnValue(client)