This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
gnu.java.nio.SelectorManager always puts all of keys() into selectedKeys()?
- From: Adam Megacz <adam at megacz dot com>
- To: java at gcc dot gnu dot org
- Date: Mon, 28 May 2007 16:45:24 -0700
- Subject: gnu.java.nio.SelectorManager always puts all of keys() into selectedKeys()?
Forgive me if I'm confused here...
In gnu/java/nio/SelectorManager.java on line 227, VMSelector.select()
is invoked. It appears that unless that method throws an exception,
the following while loop (line 228) will always add every element in
keys() into selectedKeys() -- I see no control statements between the
top of the loop and line 305, where the key is added if it isn't
already in the selected set.
Is this the desired behavior?
Hopefully I'm just confused here. But if this is actually a bug, let
me know and I'll post a patch.
Context: I was trying out Jetty under GCJ, and the NIO-based server
doesn't cope well with the situation where Selector.select() returns 0
*and* adds elements to the selected set (the return value is supposed
to be the number of elements added to the selected key set).
- a
--
PGP/GPG: 5C9F F366 C9CF 2145 E770 B1B8 EFB1 462D A146 C380