Re: Looking for an idea to implement a network application with protobuf

2008-12-17 Thread Stuart Johnson


>
> The question is, is this the most common and efficient way to exchange
> various types of messages with protobuf? 


Its very efficient, whilst keeping flexibility.  To stream it, I add 3+ 
bytes.

Start byte
Length byte(s)
   ProtoWrapper (which includes message type enumerator)
  ProtoMessage
End byte

Once the Length byte is read, I verify that the end byte is where it 
should be before deserialising (just in case the client is sending buggy 
messages, and you loose sync).

All my message types are defind in a large enumerator.  I'm hoping one 
day the protobuf compiler will build that for me.

Stuart.





--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@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
-~--~~~~--~~--~--~---



Looking for an idea to implement a network application with protobuf

2008-12-17 Thread Trustin Lee

Hi,

I'm currently trying to write a prototype client / server application
that exchanges a message which is encoded with protobuf format.  From
my understanding, it seems like a user usually defines a top level
message type that can be a container of other messages.  This approach
is called 'extension', and is described here in detail:

  * Official documentation - http://tinyurl.com/56cerv
  * Forum discussion - http://tinyurl.com/5zabns

The question is, is this the most common and efficient way to exchange
various types of messages with protobuf?  What did you do to build a
network application with many complex message types?  Is there any
alternative approach that might be used in a certain case?  I'd like
to hear your experience.

Thanks,
Trustin
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@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
-~--~~~~--~~--~--~---