Commit b4a2507a authored by Timothy Pratama's avatar Timothy Pratama
Browse files

(client) fix client socket connection protocol.

parent acc8545b
......@@ -123,24 +123,24 @@ public class Helper {
DataOutputStream output = new DataOutputStream(client.getOutputStream());
/* Python Server */
// output.write(message.getBytes());
output.write(message.getBytes());
/* Server Java */
output.writeUTF(message);
// output.writeUTF(message);
InputStream stream = client.getInputStream();
/* Pthyon Server */
// byte[] data = new byte[4096];
// int count = stream.read(data);
// String response = new String(data);
byte[] data = new byte[4096];
int count = stream.read(data);
String response = new String(data);
/* Server Java */
DataInputStream input = new DataInputStream(stream);
String response = input.readUTF();
// DataInputStream input = new DataInputStream(stream);
// String response = input.readUTF();
/* Python Server */
// response = response.substring(0, count);
response = response.substring(0, count);
/* Server Java */
......
Supports Markdown
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