We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f0e162c commit 2745a18Copy full SHA for 2745a18
src/main/java/com/algorithm/study/demo/nio/ServerSocketChannelTest.java
@@ -29,6 +29,7 @@ public void init() throws IOException {
29
server.configureBlocking(false);
30
// 将server注册到指定Selector对象
31
server.register(selector, SelectionKey.OP_ACCEPT);
32
+ // 一直阻塞到某个注册的通道有事件就绪
33
while (selector.select() > 0) {
34
// 依次处理selector上的每个已选择的SelectionKey
35
for (SelectionKey sk : selector.selectedKeys()) {
0 commit comments