Hi David Renshaw && Kenton Varda

  

    In C++ server I do like this 

    capnp::MallocMessageBuilder message;

    Info::Builder info = message.initRoot<Info>();

    info.setId(123);

    info.Titile("this is how to use capn");

  

    




    kj::ArrayPtr<const kj::ArrayPtr<const capnp::word>> segments = 
message.getSegmentsForOutput();







    and then convert segments[0] to char* and send it by rpc_call to java client







    In java client ,I read capn object like this :

    




    ByteString object_bytes = rpc_response.getResponseData();

    MessageReader message = 
org.capnproto.Serialize.read(object_bytes.asReadOnlyByteBuffer());,

    Info.Reader adInfo = message.getRoot(Info.factory);







C++ server and Java Client communication by rpc_call




but happen Error like this:




Exception in thread "main" java.lang.IllegalArgumentException

at java.nio.Buffer.limit(Buffer.java:275)

at org.capnproto.Serialize.read(Serialize.java:140)

at org.capnproto.Serialize.read(Serialize.java:111)




How Can I do , This problem has been bothering me for many days. thanks




whutbd

-- 
You received this message because you are subscribed to the Google Groups 
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/capnproto/447f99a8.a85d.16e605f6fb4.Coremail.18511870830%40163.com.

Reply via email to