We're currently looking at using protobuf for communication between a
number of clients (java and iPhone) and a java server but I'm a bit
confused how to best implement our protocol.

Our protocol consists of a big number of possible messages but I can't
seem to find a way for protobuf to help me decide which message was
sent.
Writing and parsing messages is really easy when I know what exact
message is being sent but this will never be the case in our
application.

We could write a field first in the message with some identifier of
what message type is being sent but this feels to me like something a
protocol tool should solve. If we have to go down that route what
would be a good identifier? Is the index of the messages descriptor
good enough or do I have to define it in the proto-file somehow?

I guess these are very simple questions but I've been trying to find
the answers in the documentation and at least I can't find it. Maybe
add an example of how to handle multiple possible messages, the
current Address Book example feels a little too basic.

BR
Per

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to