This is most likely a bug in your code -- you probably aren't transmitting
the message correctly.  Please make sure that the bytes you give to the
protobuf parser on the receiving end are exactly the same bytes that were
produced by the serializer at the sending end -- both the size and contents
must be identical.  If you are still having problems, please write a small
example program demonstrating the issue and send it to me to debug.
On Sun, Jul 5, 2009 at 11:30 PM, Vijay Mathew
<vijay.the.sche...@gmail.com>wrote:

>
> Hello all,
>
> I have a Message type EventStatus with the following definition:
>
> message EventStatus {
>     required int32 reason = 1;
>     required string msg = 2;
> }
>
> This is part of a larger protocol where a C++ client sends an event to
> a Java server where it is handled. The Java server returns an
> EventStatus. If the reason field is 0 (success), protobuf parser on C+
> + side does not read the value of the msg field. If the reason field
> is > 0, then it works fine. As a workaround I reversed the order of
> the two fields:
>
> message EventStatus {
>     required string msg = 1;
>     required int32 reason = 2;
> }
>
> Now the msg field is read even when reason is zero.
>
> Why this strange behavior? Is this a known bug is protobuf?
>
> Thanks,
>
> -- Vijay
> >
>

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