public class SocketSelector extends ESSelector
NioSocketChannel
. It's main piece of functionality is
handling connect, read, and write events.Constructor and Description |
---|
SocketSelector(SocketEventHandler eventHandler) |
SocketSelector(SocketEventHandler eventHandler,
java.nio.channels.Selector selector) |
Modifier and Type | Method and Description |
---|---|
void |
queueWrite(WriteOperation writeOperation)
Queues a write operation to be handled by the event loop.
|
void |
queueWriteInChannelBuffer(WriteOperation writeOperation)
Queues a write operation directly in a channel's buffer.
|
void |
scheduleForRegistration(NioSocketChannel nioSocketChannel)
Schedules a NioSocketChannel to be registered by this selector.
|
addRegisteredChannel, close, close, getRegisteredChannels, isOnCurrentThread, isOpen, isRunning, isRunningFuture, queueChannelClose, rawSelector, removeRegisteredChannel, runLoop
public SocketSelector(SocketEventHandler eventHandler) throws java.io.IOException
java.io.IOException
public SocketSelector(SocketEventHandler eventHandler, java.nio.channels.Selector selector) throws java.io.IOException
java.io.IOException
public void scheduleForRegistration(NioSocketChannel nioSocketChannel)
nioSocketChannel
- the channel to registerpublic void queueWrite(WriteOperation writeOperation)
writeOperation
- to be queuedpublic void queueWriteInChannelBuffer(WriteOperation writeOperation)
writeOperation
- to be queued in a channel's buffer