key.oldInterestOps = key.interestOps();
boolean isReadableChannel = ((SelectionKey.OP_ACCEPT | SelectionKey.OP_READ) & key.oldInterestOps) != 0;
boolean isWritableChannel = ((SelectionKey.OP_CONNECT | SelectionKey.OP_WRITE) & key.oldInterestOps) != 0;
SelectableChannel channel = key.channel();
if (isReadableChannel) {
readChannelList.add(channel.keyFor(this));
readableFDs.add(((FileDescriptorHandler)channel).getFD());
}
if (isWritableChannel) {
writeChannelList.add(channel.keyFor(this));
writableFDs.add(((FileDescriptorHandler)channel).getFD());