On Oct 13, 2010, at 15:13 , Paul wrote:
On the client side (in C++), I open a TCP socket connection on the
same port with the server's IP address.  I serialize the message using
SerializeToCodedStream into an array using ArrayOutputStream.  After
serializing it, I send it over the TCP connection using my sendTCP
method which uses C++ sockets.

SerializeToCodedStream does *not* prepend the message size. The Java side is expecting that the message will start with the message length, so that is probably why you are getting parse errors. You need to do something like:



Hope this helps,


(as an aside: the C++ API really should have an equivalent to writeDelimitedTo and parseDelimited on the Java side).

Evan Jones

You received this message because you are subscribed to the Google Groups "Protocol 
Buffers" group.
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to