Andersen wrote:
>
> I am doing non-blocking I/O with NIO when reading and writing to sockets.
>
> My Selector.select() call returns with result 0, and does not block,
> which it is supposed to do. What can be wrong? I am not doing wakeup()
> and no exceptions are being thrown.
The remaining possibility, according to the documentation, is that the
thread has been interrupted. The docs do no mention clearing the status.
So presumably an interrupted selection thread will spin. You can check
and clearly the interrupt status with the oddly named Thread.interrupted.
http://download.java.net/jdk6/docs/a...l#interrupted()
OTOH, it's not exactly unknown for NIO to have bugs.
Tom Hawtin
--
Unemployed English Java programmer
http://jroller.com/page/tackline/