Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
01-22-2011, 12:43 AM #1
- Join Date
- Jan 2011
- Thanked 0 Times in 0 Posts
Data sent on closing the InputStream
I'm integrating a Serial Device and using javax.comm.SerialPort, with java.io.InputStream and java.io.OutputStream as below :
serialPort = (SerialPort) portId.open(name, portNumber);
outputStream = serialPort.getOutputStream();
inputStream = serialPort.getInputStream();
serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
This was working good, but quite recently when we have a new device to be integrated, intermittently, I see an issue where when the data is written to the outputstream, is reaching the Device only when closing the InputStream.
So the device does not respond, and when my java code times out and tries to close the connection, it starts responding.
Very weird issue and was wondering if anyone faced such an issue.
Note : Am using a Mac OS X 10.6 (Snow Leopard)
01-22-2011, 06:19 PM #2
- Join Date
- Feb 2010
- Manchester, UK
- Thanked 13 Times in 13 Posts
Try Flushing Output Stream. It should work properly then.
Then get back here with news ^^