事情发生时:
- 客户端发起连接请求,会触发acccept事件
- 客户端发送数据过来,客户端正常、一次关闭时,都会触发read事件,另外如果发送的疏忽大于buffer缓冲区,会触发多次读取事件
- channel可写,会触发write事件
调用selector.wakeup()
调用selector.close()
selector所在线程interrupt
事情发生时:
调用selector.wakeup()
调用selector.close()
selector所在线程interrupt