RE: Emulate hash_map using map when necessary.

2008-09-19 Thread Choiniere.Vincent
You can submit it, the code is correct. Thank you. De : Kenton Varda [mailto:[EMAIL PROTECTED] Envoyé : 18 septembre 2008 17:13 À : [EMAIL PROTECTED]; Choinière, Vincent; protobuf@googlegroups.com Objet : Re: Emulate hash_map using map when necess

Any small sample Class Service code for Java

2008-09-19 Thread Mars
just want to find some sample code for Class Service: http://code.google.com/apis/protocolbuffers/docs/reference/python/google.protobuf.service.Service-class.html for example: given .proto .java files below, how to use simply use them in some basic Java network program, such as ServerSocket or D

Re: Emulate hash_map using map when necessary.

2008-09-19 Thread Kenton Varda
submitted. Thanks for prodding me into fixing this. :) On Fri, Sep 19, 2008 at 6:41 AM, <[EMAIL PROTECTED]> wrote: > You can submit it, the code is correct. > > > > Thank you. > > > > > > > > > -- > > *De :* Kenton Varda [mailto:[EMAIL PROTECTED] > *Envoyé :* 18 se

Multiple proto buffers on the same wire

2008-09-19 Thread BeamMeUpScotty
We're looking at a scenario where there could possibly be many different messages on the same wire. For example, DeviceA and DeviceB communicate with a PC. Both DeviceA and DeviceB use the same functional network, and they also use different Proto messages. The question that we're wrestling wit

Re: Multiple proto buffers on the same wire

2008-09-19 Thread Kenton Varda
You'll have to stick some sort of one-byte tag on the front of the message to identify which type it is. On Fri, Sep 19, 2008 at 11:05 AM, BeamMeUpScotty <[EMAIL PROTECTED]>wrote: > > We're looking at a scenario where there could possibly be many > different messages on the same wire. For exampl

Re: Any small sample Class Service code for Java

2008-09-19 Thread Kenton Varda
On Fri, Sep 19, 2008 at 9:50 AM, Mars <[EMAIL PROTECTED]> wrote: > > just want to find some sample code for Class Service: > > http://code.google.com/apis/protocolbuffers/docs/reference/python/google.protobuf.service.Service-class.html That's the Python version. Shouldn't you be looking at the

Does SerializeToXxx() guarantee a call to ByteSize()?

2008-09-19 Thread Leandro Lucarella
Hi. I guess SerializeToXxx() methods internally calls to ByteSize(), so after a serialization, I can call GetCachedSize(). My question is, first, is this true? =) And second, can I rely on this? The use case is this: pkt.SerializeToArray(buffer, SIZE); send(fd, buffer, pkt.GetCachedSize(), 0);

Re: Does SerializeToXxx() guarantee a call to ByteSize()?

2008-09-19 Thread Kenton Varda
You probably shouldn't rely on this. Some of the serialization methods will guarantee this, some won't. What you can do is call ByteSize() yourself, and then use SerializeWithCachedSizes(), which requires that ByteSize() was already called and won't call it again. You'll have to do a small amoun

Re: Any small sample Class Service code for Java

2008-09-19 Thread Mars
On 9月20日, 上午3时34分, "Kenton Varda" <[EMAIL PROTECTED]> wrote: > On Fri, Sep 19, 2008 at 9:50 AM, Mars <[EMAIL PROTECTED]> wrote: > > > just want to find some sample code for Class Service: > > >http://code.google.com/apis/protocolbuffers/docs/reference/python/goo... > > That's the Python version.

Re: Does SerializeToXxx() guarantee a call to ByteSize()?

2008-09-19 Thread Leandro Lucarella
Kenton Varda, el 19 de septiembre a las 16:12 me escribiste: > You probably shouldn't rely on this. Some of the serialization methods will > guarantee this, some won't. What you can do is call ByteSize() yourself, > and then use SerializeWithCachedSizes(), which requires that ByteSize() was > al