Commit ec585f1a authored by Geoffrey Thomas's avatar Geoffrey Thomas

Update RPC docs for the change to a single bootstrap interface (9a32fa73).

parent e93ff72e
...@@ -352,9 +352,8 @@ int main(int argc, const char* argv[]) { ...@@ -352,9 +352,8 @@ int main(int argc, const char* argv[]) {
capnp::EzRpcClient client(argv[1], 5923); capnp::EzRpcClient client(argv[1], 5923);
auto& waitScope = client.getWaitScope(); auto& waitScope = client.getWaitScope();
// Request the service named "foo" from the server. // Request the bootstrap capability from the server.
MyInterface::Client cap = MyInterface::Client cap = client.getMain<MyInterface>();
client.importCap<MyInterface>("foo");
// Make a call to the capability. // Make a call to the capability.
auto request = cap.fooRequest(); auto request = cap.fooRequest();
...@@ -395,15 +394,12 @@ int main(int argc, const char* argv[]) { ...@@ -395,15 +394,12 @@ int main(int argc, const char* argv[]) {
} }
// Set up the EzRpcServer, binding to port 5923 unless a // Set up the EzRpcServer, binding to port 5923 unless a
// different port was specified by the user. // different port was specified by the user. Note that the
capnp::EzRpcServer server(argv[1], 5923); // first parameter here can be any "Client" object or anything
auto& waitScope = server.getWaitScope();
// Export a capability under the name "foo". Note that the
// second parameter here can be any "Client" object or anything
// that can implicitly cast to a "Client" object. You can even // that can implicitly cast to a "Client" object. You can even
// re-export a capability imported from another server. // re-export a capability imported from another server.
server.exportCap("foo", kj::heap<MyInterfaceImpl>()); capnp::EzRpcServer server(kj::heap<MyInterfaceImpl>(), argv[1], 5923);
auto& waitScope = server.getWaitScope();
// Run forever, accepting connections and handling requests. // Run forever, accepting connections and handling requests.
kj::NEVER_DONE.wait(waitScope); kj::NEVER_DONE.wait(waitScope);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment