Sending protobuf serialized object from c# to java server not working? -
I have a simple C # client app that sends objects to the Java based server app. Note: I am using ProtoBuff-Net on the Clint Side. Simple to this application I have. Proto file is only one field and. The Javascript is generated by the Protocol compiler with the Java class.
.profo file: C # client to send objects Problem: A serialized message sent by C #Ap is not available. Even I have not got any error, that is why I am unable to assess the problem. "Problem: I can not find the serialized message" / p> Em> sound is just like the classic "socks stams" problem (second example here :). If you have written data in any stream but have not closed the stream, then the stream that is does not end also does not automatically know that the client has sent 117 bytes (say to say) Which should be considered a message. You have two options:
message person {required string id = 1; }
MemoryStream ms = new MemoryStream (); Per person = new person (); Per.id = "TestId001"; Serializer.Serialize & lt; Person & gt; (MS, copy); Byte [] Buffer = MS ToArray (); ClientSocket.SendTo (buffer, host app); Person person = purse Parsfram (socket.getInputStream ()); System.out.println ("id:" + person.getId ());
person objects in the stream (or stream closed) in one frame, and then hope to be able to get 3
person Object on the other end: You will find a
person object in this scenario, the easiest option is to add the cover object, i.e.
Comments
Post a Comment