On Mon, Aug 19, 2013 at 8:37 PM, Tom Ward <tw...@thefoundry.co.uk> wrote:
>
> Basically I'm trying to work out how to deserialize a protobuf message
> without using the generated headers, as we're likely to get messages that
> weren't generated at compile time. I've looked through the documentation,
> but I only seem to be able to find ones that use generated classes to
> deserialize, or that use a Descriptor from a generated class to create a
> DynamicMessage, which I can't seem to work out how to do when we don't have
> the proto.
>

The protobuf encoding isn't self-describing; generally you need either a
compiled message definition or a Descriptor to make sense of an encoded
message.
Without one of those, there is not much you can do beyond splitting the
message into opaque fields that you will have difficulty in interpreting
further.

As Descriptors can be turned into protobuf messages, one approach is to
include a serialized Descriptor as part of the standard message framing;
then you can use DynamicMessage on the receiver side.
See
https://developers.google.com/protocol-buffers/docs/techniques#self-description

Oliver

-- 
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/groups/opt_out.

Reply via email to