I'm trying to read data from Bio-metric device Using Socket Object following this Link . When I run code, Device seems stop working. And Connection status return true. But no Data print.
What is the problem with this code? Please, someone suggest me.
I'm trying like this...
public void readDataFromDevice(){
try{
System.out.println("<-----Read Data From Device------>");
String host = "192.168.0.113";
Socket requestSocket = new Socket(host, 4370);
System.out.println("Socket status : " + requestSocket.isConnected());
BufferedReader in = new BufferedReader(new InputStreamReader(requestSocket.getInputStream()));
in.lines().forEach((l)->{
System.out.println("Data => "+l);
});
}catch(UnknownHostException e){
e.printStackTrace();
}catch(ConnectException e){
e.printStackTrace();
}catch(IOException e){
e.printStackTrace();
}catch(Exception e){
e.printStackTrace();
}
}
And Here its output...
Thanks..