Netty Selector的工作过程
NioEventLoop#openSelector Selector准备的开端
private Selector openSelector() {
final AbstractSelector selector;
try {
selector = this.provider.openSelector(); //1. 创建一个平台级的Selector实现类
} catch (IOException var7) {
throw new ChannelException("failed to open a new selector", var7);
}
if (DISABLE_KEYSET_OPTIMIZATION) {
return selector;
} else {
final SelectedSelectionKeySet selectedKeySet = new SelectedSelectionKeySet();
Object maybeSelectorImplClass = AccessController.doPrivileged(new PrivilegedAction<Object>() {
public Object run() {
try {