Client side:
out = new DataOutputStream(connection.getOutputStream());
String process;
System.out.println("Connecting to server on "+ host + " port " + port +" at " + timestamp);
process = "Connection: "+host + ","+port+","+timestamp;
System.out.println("client len " + process.length());
out.write(process.length());
Prints: Client len 55
Server side:
in = new DataInputStream(connection.getInputStream());
while (true) {
int len = in.readInt();
System.out.println("Length of pkt: "+len);
Prints: Length of pkt: 927166318
What's going on here? I tried writing 0 and it printed 3621743 on the server side. I checked some other sites and a few people had problems with other streams. I read about the issues arising with big vs little endianness, but I am not sure what the problem is here since I am using the data*streams that should work fine with each other.