参考:http://ifeve.com/selectors/
Selector 选择器
创建Selector:Selector.open();
在Selector中注册通道
SelectionKey key = channel.register(selector,Selectionkey.OP_READ);
遍历SelectionKey
ServerSocketChannel
serverSocketChannel.configureBlocking(false);
参考:http://ifeve.com/selectors/
Selector 选择器
创建Selector:Selector.open();
在Selector中注册通道
ServerSocketChannel
serverSocketChannel.configureBlocking(false);