This has nothing to do with protobuf or files, and everything related to your comms protocol, in particular "framing". It just means: how you produce sub-messages in a single thread. For example, if it is a raw socket that you can send (all)
- short message type, possibly byte: 01 for a file, 02 for a protobuf message for a specific file.
- length prefix (usually 4 bytes in byte order)
- payload consisting of the previous number of bytes
Then rinse and repeat for each message.
You do not indicate which comments you ask, so I can be more specific.
Btw, another approach would be to treat the file as a protobuf message with the [] member byte - basically suitable for small files, though
source share