Adding the delete operator was good, now actually data it send, as the
socket.send function now returns a value > 0.
I did not read the message length prior to calling parse, but I
CodedInputStream cis =
NameProtos.Name name =
Sadly, I keep getting:
com.google.protobuf.UninitializedMessageException: Message missing
required fields: name
On Apr 15, 7:03 pm, Jason Hsueh <jas...@google.com> wrote:
> yup, that's what I meant. Can you check that you are writing data to the
> stream? Also, I didn't notice that you are writing the message length as a
> header. Did you read that value from the socket prior to calling parse? The
> Java-side parseFrom call should only be reading the data read by
> SerializeToCodedStream(); you need to consume the WriteLittleEndian32 data
> On Fri, Apr 15, 2011 at 10:01 AM, platzhirsch
> > I am sorry, could you clarify this? With destroy you mean call the
> > delete operator? The changes:
> > boost::asio::streambuf b;
> > std::ostream os(&b);
> > ZeroCopyOutputStream *raw_output = new OstreamOutputStream(&os);
> > CodedOutputStream *coded_output = new CodedOutputStream(raw_output);
> > coded_output->WriteLittleEndian32(name.ByteSize());
> > name.SerializeToCodedStream(coded_output);
> > delete coded_output;
> > delete raw_output;
> > socket.send(b);
> > ---
> > This changes nothing, sadly.
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Protocol Buffers" group.
> > To post to this group, send email to firstname.lastname@example.org.
> > To unsubscribe from this group, send email to
> > protobuf+unsubscr...@googlegroups.com.
> > For more options, visit this group at
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To post to this group, send email to email@example.com.
To unsubscribe from this group, send email to
For more options, visit this group at