[Rxtx] receive timeout under windows xp
marcopar at gmail.com
marcopar at gmail.com
Thu Oct 2 03:10:48 MDT 2008
So? Is it a normal behavior? Is it a bug? Is it a known issue but can't
be solved? Maybe i did something wrong? Suggestions?
marcopar at gmail.com wrote:
> Hi,
> i'm doing some test on the receive timeout behavior under windows xp pro
> and i found some odd things.
>
> Setting a value under 150000 everything works as expected, there's some
> delay tough, the timeout triggers some seconds later.
>
> This imprecision can be significant, for example if set it to 170000, i
> have the timeout at 180000.
> But the big problem is that:
> if i set a timeout of 160000 the read timeouts after about 128000
> if i set a timeout of 180000 the read timeouts after about 16000 (yes,
> 16sec)
>
> There's no randomness in these values, everytime i have the same results.
> Same behaviour can be obtained in windows server 2003.
>
> The same tests under Linux give results as expected with all values of
> timeout and timeout triggers more precisely than on windows.
>
> I'm using normal serial lines.
> I made the test with something connected to the line and without.
>
>
>
> Here's the test code i'm using to do the tests:
>
> public static void main(String args[]) {
> try {
> CommPortIdentifier portId =
> CommPortIdentifier.getPortIdentifier("COM1");
> RXTXPort serialPort = (RXTXPort) portId.open("yaya", 50);
> serialPort.setSerialPortParams(115200,
> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
> serialPort.enableReceiveTimeout(180000);
> long t = System.currentTimeMillis();
> int resp = serialPort.getInputStream().read();
> t = System.currentTimeMillis() - t;
> System.err.println(t + " " + resp);
> serialPort.close();
> } catch(Exception ex) {
> ex.printStackTrace();
> }
> }
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
> .
>
More information about the Rxtx
mailing list