Netty selector的运行
终于Selector要开始工作了。
NioEventLoop#selectNow 非阻塞
Selector#selectNow()
public int selectNow() throws IOException {
return this.lockAndDoSelect(0L);
}
Selector#lockAndDoSelect
NioEventLoop#select
private void select(boolean oldWakenUp) throws IOException {
//拿到selector
Selector selector = this.selector;
try {
int selectCnt = 0;
long currentTimeNanos = System.nanoTime();
long selectDeadLineNanos = currentTimeNanos + this.delayNanos(currentTimeNanos);
while