@ Handler public void onNioRegistration ( NioRegistration event ) throws IOException { SelectableChannel channel = event . ioChannel ( ) ; channel . configureBlocking ( false ) ; SelectionKey key ; synchronized ( selectorGate ) { selector . wakeup ( ) ; // make sure selector isn't blocking key = channel . register ( selector , event . ops ( ) , event . handler ( ) ) ; } event . setResult ( new Registration ( key ) ) ; }
Handle the NIO registration .