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
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