Ejemplo n.º 1
0
def main(reactor, description):
    endpoint = endpoints.clientFromString(reactor, description)
    client = JSONRPCClientFactory(endpoint, reactor=reactor)

    try:
        r = yield client.callRemote('bar.foo')
    except JSONRPCClientError as e:
        print e

    r = yield client.callRemote('bar.add', 1, 2)
    print "add result: %s" % str(r)

    r = yield client.callRemote('bar.whoami')
    print "whoami result: %s" % str(r)
Ejemplo n.º 2
0
 def setUp(self):
     self.reactor = task.Clock()
     self.endpoint = FakeEndpoint()
     self.factory = JSONRPCClientFactory(self.endpoint,
                                         reactor=self.reactor)