First thought: what language / platform is this? the C++ generated code is very different to the Java generated code, for example
Second thought: 2.6 is pretty old; it is very possible that a bug existed and has been fixed since then (Aug 2014) - does it still happen with more recent releases? The scenario you present seems fine and reasonable. Marc On 10 April 2018 at 03:46, Tony Tony <[email protected]> wrote: > Hi, > > I have a strange case I'm dealing with. Using protobuf compiler 2.6. > > Every time I send a certain set of values over my socket, it ends up with > missing data. Although I've compared the string received after > serialization on the server and on receiving the string on the client and > they are exactly the same, yet the values are all -1. > > I've attached a snippet of the proto file below. > > At this point these are below combos that always fail > > type=99, count= 0, index = 1 (all values are -1 after deserialization) > type=99, count=99, index= 1 (works) > type=99999, count=999999, index= 1 (works) > > - Basically anytime count is 0, all the values seem to be -1. However if I > make type 0, the same behavior does not occur. Am I missing something or > there is some underlying bug in my code? Again I've checked multiple times > the correct raw string data is being sent (with correct size). I use the > parseFromString method to parse the receiving string data. > > - I've sent plenty of other types of data just fine. > > - There are other messages defined in the same protobuf packet definition > file, can that make a difference? > > message packet { > required int32 type = 1 [default = -1]; > required int32 count = 2 [default = -1]; > required int32 index = 3 [default = -1]; > } > > Thanks > > -- > You received this message because you are subscribed to the Google Groups > "Protocol Buffers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/protobuf. > For more options, visit https://groups.google.com/d/optout. > -- Regards, Marc -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/protobuf. For more options, visit https://groups.google.com/d/optout.
