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.