invalidTag() exception

2009-03-17 Thread kolahdouzan
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:

Re: invalidTag() exception

2009-03-17 Thread kolahdouzan
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