Protobuf is a way to encode a message (data) to a byte stream. It does
not provide any sort of framing/type/etc information. You have to
supply that separately. For example a given endpoint may accept only
one type of message. Or you have another "standard" header type
message that describes what data comes next.

On Sat, Feb 28, 2015 at 4:30 PM,  <convuls...@gmail.com> wrote:
> Hi,
>
> I'm new to protocol buffers, and I've searched the docs without a clear
> answer to my question.
>
> I've defined several messages in a .proto file. I would like to use protocol
> buffers to serialize/deserialize these messages as commands between two
> processes. The .proto file was compiled with protoc, etc.
>
> The problem is I don't see how in the code the destination can figure out
> which message it is receiving.  All examples assume the destination knows
> which message it is receiving.
>
> I see the discussion of streaming multiple messages and self-describing
> messages, but neither seems to be what I need to do.
>
> This seems like a typical use case to me.  Can anyone point me to an example
> that shows how to determine the type of a received message or a link to an
> explanation?
>
> I've been using 2.6.1, not the recent 3 release.
>
> Thank you very much for any help!
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to protobuf+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at http://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to