475476477478479480481482483484485
// process cancellation AbstractSelectableChannel canceled_channel = (AbstractSelectableChannel)obj; try{ SelectionKey key = canceled_channel.keyFor( selector ); if( key != null ){ key.cancel(); //cancel the key, since already registered }