Add bootstrap RPC methods

This is the new way for initializing RPC connections. It replaces the
deprecated restore functionality
This commit is contained in:
Jason Paryani
2015-02-24 11:22:43 -08:00
parent 6c5e363406
commit 6e94182a3e
6 changed files with 46 additions and 7 deletions

View File

@@ -86,3 +86,17 @@ def test_ez_rpc():
with pytest.raises(capnp.KjException):
response = remote.wait()
def test_simple_rpc_bootstrap():
read, write = socket.socketpair(socket.AF_UNIX)
server = capnp.TwoPartyServer(write, bootstrap=Server(100))
client = capnp.TwoPartyClient(read)
cap = client.bootstrap()
cap = cap.cast_as(test_capability_capnp.TestInterface)
remote = cap.foo(i=5)
response = remote.wait()
assert response.x == '125'