public void unRegister(SocketChannel channel){
  if (channel.isRegistered()) {
    SelectionKey key=channel.keyFor(mReadSelector);
    if (key != null) {
      key.cancel();
      mReadRegisterMap.remove(key);
      mReadSelector.wakeup();
    }
    key=channel.keyFor(mWriteSelector);
    if (key != null) {
      key.cancel();
      mWriteRegisterMap.remove(key);
      mWriteSelector.wakeup();
    }
  }
}

public void unRegister ( SocketChannel channel ) { if ( channel . isRegistered ( ) ) { SelectionKey key = channel . keyFor ( mReadSelector ) ; if ( key != null ) { key . cancel ( ) ; mReadRegisterMap . remove ( key ) ; mReadSelector . wakeup ( ) ; } key = channel . keyFor ( mWriteSelector ) ; if ( key != null ) { key . cancel ( ) ; mWriteRegisterMap . remove ( key ) ; mWriteSelector . wakeup ( ) ; } } }
cancel a socketchannel register
