rpc implementation with c++