Probably you are treating the bytes as a NUL-terminated string somewhere,
and so the message is being cut short at the zero.  Protocol messages can
contain NUL (zero-value) bytes, so you cannot pass an encoded protocol
message as a plain char* -- you must keep track of the size.

On Wed, Jul 29, 2009 at 4:48 PM, Sushil Shelly <skshe...@gmail.com> wrote:

> I have a simple enumeration in my dot-proto as follows
>
> message Bar {
>   required string name = 1;
>   required string device = 2;
> }
>
> enum msg State {
>   IDLE = 0;
>   BUSY = 1;
> }
>
> message Foo {
>   required State state = 1;
>   required Bar bar = 2;
> }
>
> now i set the required fields by using the helper methods provided by the
> object;
> the state is set to IDLE in the message.
>
> On Receiving () - I de-serialize but nothing shows up in the msg, its as if
> the required field was not set.
>
> Then in another test case I set the state to Busy and send - nothing else
> has changed,
> this time I get the message and I am able to see all information.
>
> Is this a known issue?
>
> enum msg State {
>    DO_NOT_USE = 0;
>    IDLE                 = 1;
>    BUSY               = 2;
> }
>
> IS THE WORK AROUND I AM USING
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to