mirror of
https://github.com/CyC2018/Interview-Notebook.git
synced 2026-10-31 19:13:42 +00:00
Update Java IO.md
补充 select() 被 wakeup() 或中断唤醒时可能返回 0。
This commit is contained in:
+1
-1
@@ -455,7 +455,7 @@ int interestSet = SelectionKey.OP_READ | SelectionKey.OP_WRITE;
|
||||
int num = selector.select();
|
||||
```
|
||||
|
||||
使用 select() 来监听到达的事件,它会一直阻塞直到有至少一个事件到达。
|
||||
使用 select() 来监听到达的事件,它会阻塞到至少一个通道就绪,或者被 wakeup() 或线程中断唤醒,因此返回值可能为 0。
|
||||
|
||||
#### 4. 获取到达的事件
|
||||
|
||||
|
||||
Reference in New Issue
Block a user