Commit 8f614cc4 authored by Kenton Varda's avatar Kenton Varda

Merge branch 'master' of github.com:kentonv/capnproto

parents 98b4c4f5 185f2763
......@@ -102,10 +102,8 @@ public:
virtual ~MessageReader() noexcept(false);
virtual kj::ArrayPtr<const word> getSegment(uint id) = 0;
// Gets the segment with the given ID, or returns null if no such segment exists.
//
// Normally getSegment() will only be called once for each segment ID. Subclasses can call
// reset() to clear the segment table and start over with new segments.
// Gets the segment with the given ID, or returns null if no such segment exists. This method
// will be called at most once for each segment ID.
inline const ReaderOptions& getOptions();
// Get the options passed to the constructor.
......
......@@ -352,9 +352,8 @@ int main(int argc, const char* argv[]) {
capnp::EzRpcClient client(argv[1], 5923);
auto& waitScope = client.getWaitScope();
// Request the service named "foo" from the server.
MyInterface::Client cap =
client.importCap<MyInterface>("foo");
// Request the bootstrap capability from the server.
MyInterface::Client cap = client.getMain<MyInterface>();
// Make a call to the capability.
auto request = cap.fooRequest();
......@@ -395,15 +394,12 @@ int main(int argc, const char* argv[]) {
}
// Set up the EzRpcServer, binding to port 5923 unless a
// different port was specified by the user.
capnp::EzRpcServer server(argv[1], 5923);
auto& waitScope = server.getWaitScope();
// Export a capability under the name "foo". Note that the
// second parameter here can be any "Client" object or anything
// different port was specified by the user. Note that the
// first parameter here can be any "Client" object or anything
// that can implicitly cast to a "Client" object. You can even
// 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.
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