Nevermind, we found the error. Apparently, the Java read() function
reads only up to one TCP frame before returning. Replace with
readFully() and it works fine.

Kenton Varda wrote:
> Are you sure that the data you are sending to the parser is exactly
> the same data that was generated by the serializer?  Remember that
> protocol buffers are not self-delimiting, so you need to make sure
> that you limit the input to the exact number of bytes that were
> produced when serializing.
>
> If the data is exactly the same, then this is a bug.  If you can
> create a small program or pair of programs that demonstrate the
> problem, I would be happy to debug it.
>
> On Mon, Oct 13, 2008 at 10:09 AM, Dominik Steenken <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
>
>
>     Hi everyone,
>
>      we are currrently implementing a server/client system, the server
>     being implemented in c++, the client in java. During our last rounds
>     of tests, we encountered a problem that had to do with the sending of
>     (not so) long messages. on the (receiving) java side, we get the
>     following exception:
>      Exception in augnet.client.aim.connection.Receiver, Parse error:
>     com.google.protobuf.InvalidProtocolBufferException: Protocol message
>     contained an invalid tag (zero).
>     com.google.protobuf.InvalidProtocolBufferException: Protocol message
>     contained an invalid tag (zero).
>            at
>     
> com.google.protobuf.InvalidProtocolBufferException.invalidTag(InvalidProtocolBufferException.java:
>     52)
>            at
>     com.google.protobuf.CodedInputStream.readTag(CodedInputStream.java:
>     67)
>            at com.google.protobuf.FieldSet.mergeFrom(FieldSet.java:397)
>            at com.google.protobuf.AbstractMessage
>     $Builder.mergeFrom(AbstractMessage.java:248)
>            at com.google.protobuf.GeneratedMessage
>     $Builder.mergeFrom(GeneratedMessage.java:1)
>            at
>     com.google.protobuf.CodedInputStream.readMessage(CodedInputStream.java:
>     227)
>            at
>     com.google.protobuf.FieldSet.mergeFieldFrom(FieldSet.java:482)
>            at com.google.protobuf.FieldSet.mergeFrom(FieldSet.java:402)
>            at com.google.protobuf.AbstractMessage
>     $Builder.mergeFrom(AbstractMessage.java:248)
>            at com.google.protobuf.GeneratedMessage
>     $Builder.mergeFrom(GeneratedMessage.java:1)
>            at
>     com.google.protobuf.CodedInputStream.readMessage(CodedInputStream.java:
>     227)
>            at
>     com.google.protobuf.FieldSet.mergeFieldFrom(FieldSet.java:482)
>            at com.google.protobuf.FieldSet.mergeFrom(FieldSet.java:402)
>            at com.google.protobuf.AbstractMessage
>     $Builder.mergeFrom(AbstractMessage.java:248)
>            at com.google.protobuf.AbstractMessage
>     $Builder.mergeFrom(AbstractMessage.java:240)
>            at com.google.protobuf.AbstractMessage
>     $Builder.mergeFrom(AbstractMessage.java:298)
>            at augnet.client.aim.messages.MessageProtos
>     $AugNetMessage.parseFrom(MessageProtos.java:6289)
>            at augnet.client.aim.connection.Receiver.run(Receiver.java:47)
>
>     while the (sending) c++ side encounters no errors. When we scale down
>     the message, no error occurs. Is this a bug in protobuf or are we
>     doing something wrong?
>
>     Best regards,
>      Dominik
>     >
>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to