Reply To: EZSrve XML Port? 2017-12-22T00:57:50+00:00

HOME Forums Gateways EZSrve EZSrve XML Port? Reply To: EZSrve XML Port?

Anonymous
Post count: 408

Some minor tweaks



public static void main(String[] args) {
try {
Socket sock = new Socket("192.168.0.107",8002);
PrintStream ps = new PrintStream(sock.getOutputStream());
String request = "GetVersionn";
System.out.println("Request: "+request+"n");
System.out.println("Response:");
ps.println(request);
BufferedReader br = new BufferedReader(new InputStreamReader(sock.getInputStream()));
String line;
int c;
long milliseconds=5000;
long endTime = System.currentTimeMillis()+milliseconds;
c=br.read();
while (System.currentTimeMillis()<endTime) {
System.out.print((char)c);
c=br.read();
}
br.close();
ps.close();
sock.close();
} catch (Exception e) {
System.out.println(e);
}
}

This is working fine on my end. Let me know.