Never mind the question, I found out what the problem was. The buffer defined for the datagram packet was clearly larger than what I was expecting to get, and the parser was reading the whole buffer. Once I copy that buffer to a temporary buffer, up to the number of bytes I am receiving, and use the temporary buffer for the parser, everything works fine.
On Mar 17, 12:38 pm, kolahdou...@gmail.com wrote: > I have a C++ code that generates a buffer and sends it to a multicast > address, and Java based receiver that is supposed to get the buffer > and parse it. The problem I am facing is that after issuing > message.parseFrom(received_buf) or message.Builder.mergeFrom > (received_buf), I get the "Error: > com.google.protobuf.InvalidProtocolBufferException: Protocol message > contained an invalid tag (zero)." exception. I did verify the received > buffer, it has the same length and is identical byte to byte with what > the sender is sending. Also, I have the receiver side in C++, and that > one has no problem whatsoever. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---