Commit 209d20ad authored by legoc's avatar legoc
Browse files

Corrected implementation of Request.get() and Requester.send() to be coherent...

Corrected implementation of Request.get() and Requester.send() to be coherent with C++ using protobuf encoding of strings
parent 302c1a49
0.1.6
-----
* Corrected implementation of Request.get() and Requester.send() to be coherent with C++ using protobuf encoding of strings.
0.1.5
-----
......
......@@ -6,7 +6,7 @@
<version>0.0.1</version>
</parent>
<artifactId>cameo-api</artifactId>
<version>0.1.5</version>
<version>0.1.6</version>
<packaging>jar</packaging>
<properties>
......
......@@ -809,7 +809,7 @@ public class Application {
}
public String get() {
return impl.get().toStringUtf8();
return impl.getString();
}
public byte[][] getTwoBinaryParts() {
......
......@@ -57,6 +57,17 @@ public class RequestImpl {
return message2;
}
public String getString() {
byte[] data = message.toByteArray();
if (data == null) {
return null;
}
return Buffer.parseString(data);
}
public void reply(byte[] response) {
Zmq.Msg responseMessage = application.createRequest(Type.RESPONSE);
......@@ -85,4 +96,5 @@ public class RequestImpl {
public String toString() {
return "Request [endpoint=" + requesterEndpoint + ", id=" + requesterApplicationId + "]";
}
}
\ No newline at end of file
......@@ -111,7 +111,7 @@ public class RequesterImpl {
}
public void send(String request) {
send(ByteString.copyFromUtf8(request));
send(Buffer.serialize(request));
}
public void sendTwoParts(byte[] request1, byte[] request2) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment