Skip to content

Commit 2745a18

Browse files
author
liuxun
committed
Javanio socketchannel
1 parent f0e162c commit 2745a18

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/main/java/com/algorithm/study/demo/nio/ServerSocketChannelTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public void init() throws IOException {
2929
server.configureBlocking(false);
3030
// 将server注册到指定Selector对象
3131
server.register(selector, SelectionKey.OP_ACCEPT);
32+
// 一直阻塞到某个注册的通道有事件就绪
3233
while (selector.select() > 0) {
3334
// 依次处理selector上的每个已选择的SelectionKey
3435
for (SelectionKey sk : selector.selectedKeys()) {

0 commit comments

Comments
 (0)