Re: [capnproto] how to distinguish different Message Types in tcp byte stream

2022-10-25 Thread Ian Denhardt
For distinguishing the type, I would recommend wrapping your messages in a common union type, e.g: struct Message { union { login @0 :Login; commandGetData @1 :CommandGetData; # etc. } } The rpc protocol itself does something similar on the wire; see rpc.capnp. For determining me

[capnproto] how to distinguish different Message Types in tcp byte stream

2022-10-25 Thread Alex Syrnikov
Hello. I have (working on) Rust service and clients ( Rust and Node.js). I want service<->client cap'n'proto message exchange via Tcp socket (no HTTP). Messages will go via tcp connection, but I have different message types (each message is structs Login, or CommandGetData or Error...). So how