users@grizzly.java.net

Registration of SelectionKeys on connection open/close in Grizzly 2.0

From: Bo Li <b.li_at_sun.com>
Date: Mon, 15 Jun 2009 11:16:35 +0200

I noticed that the ACCEPTED and CONNECTED IO events are fired AFTER the read
interest is registered with the selector. This makes it impossible to
initialize some connection related state before processing data on the new
connection. Is it possible to move the selector registration after firing
the IO events?

Another thing, when closing a connection, the READ interest is not
deregistered from the selector and another READ IO event is fired. This
eventually leads to an EOFException or ClosedChannelException. Is this a
bug?

Thanks again
Bo