cap’n’proto beginner needs help
I need a RPC lib usable both from ocaml and c++, which can use UDP as a transport and encrypting the networked communication.
cap’n’proto seems to fit the bill, even if I havent understood what are « capabilities » in this context :-/ not a good start.
My previous exposure to RPC libs was apache thrift, which is a piece of cake to use. But no UDP, no crypto available.
My project impose me to write the server in C++, the client in OCaml. Callback to client code seems a good feat. to have in case.
I’ve tried exercise 1 of the capnp tutorial, writing Callback.log, without much success I think.
In a separate callback.ml file I wrote:
open Capnp_rpc_lwt
module Api = Echo_api.MakeRPC(Capnp_rpc_lwt)
module Callback = Api.Client.Callback
let log t msg =
Printf.printf "callback.ml/log: got msg %s\n" msg ;
let open Callback.Log in
let request, _ = Capability.Request.create Params.init_pointer in
Capability.call_for_unit t method_id request
Echo.Callback.local in main.ml trigger a compile error (unbound module Echo.Callback) with my module hierarchy.
Where do I need to put my Callback.log?
Thank for any help.