Does Cap'n Proto support delimited messages?
My goal is to write multiple messages to a file pipe and read in real-time as they are being written.
So...
The messages need to be delimited in some way.
And the parser must be able to detect incomplete messages and wait.
Yes. Unlike Protocol Buffers, Cap'n Proto messages are inherently self-delimiting. If you use the standard serialization functions to repeatedly write messages to the same stream, or repeatedly read messages from the same stream, it will "just work". Make sure to use the serialization / parsing routines that write to / read from a stream (in C++ you can use a file descriptor or an abstract InputStream/OutputStream), so that the parser knows how to wait for input. There are also asynchronous (non-blocking) versions of these if you prefer an event-driven approach.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With