/** * This method is called from the selectLoop() method in order to * process new incoming connections. */ private synchronized void processNewConnections() { synchronized (newConnections) { while (!newConnections.isEmpty()) { Connection conn = newConnections.removeFirst(); try { conn.socketChannel().register(selector, conn.selectOps(), conn); } catch (ClosedChannelException e) { log.log(Level.WARNING, "register channel failed", e); return; } } } }
channel.register(selector, conn.selectOps(), conn); } catch (java.nio.channels.ClosedChannelException e) { log.log(Level.WARNING, "register channel failed", e);