public class NioSelector extends Object
| Modifier and Type | Field and Description |
|---|---|
static ConcurrentLinkedDeque<NioSelector> |
SELECTORS |
| Constructor and Description |
|---|
NioSelector(Selector selector,
SocketContext socketContext)
事件监听器构造
|
| Modifier and Type | Method and Description |
|---|---|
SocketChannel |
getSocketChannel(SelectionKey selectionKey)
获取 socket 通道
|
static void |
register(NioSelector selector) |
void |
release() |
static void |
unregister(NioSelector selector) |
public static ConcurrentLinkedDeque<NioSelector> SELECTORS
public NioSelector(Selector selector, SocketContext socketContext)
selector - 对象SelectorsocketContext - socketContext 对象public static void register(NioSelector selector)
public static void unregister(NioSelector selector)
public SocketChannel getSocketChannel(SelectionKey selectionKey) throws IOException
selectionKey - 当前 SelectionkeyIOException - IO 异常public void release()
Copyright © 2019 Voovan. All rights reserved.