public boolean translateReadyOps ( int ops , int initialOps , SelectionKeyImpl sk ) { int intOps = sk . nioInterestOps ( ) ; // Do this just once, it synchronizes int oldOps = sk . nioReadyOps ( ) ; int newOps = initialOps ; if ( ( ops & PollArrayWrapper . POLLNVAL ) != 0 ) { // This should only happen if this channel is pre-closed while a // selection operation is in progress // ## Throw an error if this channel has not been pre-closed return false ; } if ( ( ops & ( PollArrayWrapper . POLLERR | PollArrayWrapper . POLLHUP ) ) != 0 ) { newOps = intOps ; sk . nioReadyOps ( newOps ) ; return ( newOps & ~ oldOps ) != 0 ; } if ( ( ( ops & PollArrayWrapper . POLLIN ) != 0 ) && ( ( intOps & SelectionKey . OP_ACCEPT ) != 0 ) ) newOps |= SelectionKey . OP_ACCEPT ; sk . nioReadyOps ( newOps ) ; return ( newOps & ~ oldOps ) != 0 ; }
Translates native poll revent set into a ready operation set