[Rxtx] read() not blocking?
knute at frazmtn.com
Sat Sep 23 18:58:43 MDT 2006
>On Sat, 23 Sep 2006, Knute Johnson wrote:
>> I'm converting from javax.comm to rxtx and have run in to a snag. My
>> code needs to block indefinitely on a serial port read() but is
>> returning -1. Both read timeout and read threshold are disabled. It
>> doesn't seem to matter if I call disableReceiveTimeout() or
>> enableReceiveTimeout(0). Behavior appears normal if timeout is set
>> to some normal value. For now I have enabled receive timeout and set
>> the value to Integer.MAX_VALUE.
>> Is this a bug or?
>> My computer is running XP SP2 and RXTX is 2.1-7.
>> Any ideas would be greatly appreciated.
>I would expect that to work. Is your serial port unusual? Perhaps
>multiport or a USB dongle?
No it is the built-in port on my Dell 380. Nothing unusual about it.
I did another experiment and found that even with the
Integer.MAX_VALUE timeout, about every minute and 20 seconds the
read() returned a -1. There is something funny here.
Anything you want me to try?
More information about the Rxtx