文章目录 前言 原理解析 总结 前言 在NIO编程中,Server 通常会写一个无限循环的代码,Selector 持续监听新的事件: //NIO System.out.println("等待连接...."); while (true){ selector.select();