Index: main/java/com/sun/grizzly/http/SelectorThread.java =================================================================== --- main/java/com/sun/grizzly/http/SelectorThread.java (revision 432) +++ main/java/com/sun/grizzly/http/SelectorThread.java (working copy) @@ -47,7 +47,6 @@ import java.net.Socket; import java.net.SocketException; import java.util.Iterator; -import java.util.Set; import java.util.logging.Logger; import java.util.logging.Level; import java.util.concurrent.ConcurrentLinkedQueue; @@ -617,7 +616,7 @@ controller.setSelectorHandler(selectorHandler); DefaultSelectionKeyHandler keyHandler = - new DefaultSelectionKeyHandler(){ + new DefaultSelectionKeyHandler(selectorHandler){ public void expire(Iterator keys){ super.expire(keys); if (isMonitoringEnabled()) { @@ -634,7 +633,7 @@ }; keyHandler.setLogger(logger); keyHandler.setTimeout(keepAliveTimeoutInSeconds * 1000); - controller.setSelectionKeyHandler(keyHandler); + selectorHandler.setSelectionKeyHandler(keyHandler); final DefaultProtocolChain protocolChain = new DefaultProtocolChain(){ public void execute(Context ctx) throws Exception {