You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not planning on implementing the RPC spec myself as it's not a good fit for what I'm doing with capnp.
As a workaround I usually have a union for request/response and switch on them when sending/receiving a message. I then wrap it in functions so it looks like RPC.
Something like this:
//client side
void add(int a, int b)
{
sendPacket((ref Packet.Builder packet) {
packet.initRequest().setAdd(a, b);
});
}
//server side
switch(request.which())
{
case Packet.Request.Which.Add:
{
sendPacket((ref Packet.Builder packet) {
packet.initResponse().setSum(packet.request.a + packet.request.b);
});
}
}
No description provided.
The text was updated successfully, but these errors were encountered: