I am trying to read data from 5 devices connected serially.my Java code is running fine if the device is healthy, if not then
inputstream.read() hangs the program and does not allow further execution.
I have tried using
BufferedInputStream.. . but nothing works.
What i want to do is :if a device does not respond my code, it should end itself and let the control go to the main program where it will go to the next device.the socket remains open for one cycle of polling.
Socket es = new Socket("10.12.90.153",4001); OutputStream osnew= es.getOutputStream(); InputStream isnew = new BufferedInputStream(es.getInputStream());
This is done in the task program, then i pass
isnew to each device at a gap of one second for further action.the
osnew writes some data to which the device responds.then i read from
isnew.. .This where the program hangs.