Constructor and Description |
---|
PrimaryListener(Selector selector,
LogConfig config,
Queue<SocketChannel> acceptQueue)
Constructs the primary listener with this selector.
|
Modifier and Type | Method and Description |
---|---|
void |
register(SelectableChannel channel,
int operation,
Object attachment)
Adds/changes the channel registration from another thread.
|
protected void |
selectorOps(Selector selector)
Hook for additional operations to be taken before the selector goes
back to block on select.
|
acceptNewClient, run
public PrimaryListener(Selector selector, LogConfig config, Queue<SocketChannel> acceptQueue)
selector
- The selectorconfig
- The log configurationacceptQueue
- The accept queueprotected void selectorOps(Selector selector) throws IOException
selectorOps
in class Listener
selector
- The selectorIOException
- Error registering the selector with the channelpublic void register(SelectableChannel channel, int operation, Object attachment)
channel
- The channel to registeroperation
- The operation of interestattachment
- The attachment