public class NioDatagramWorker extends AbstractNioWorker
Selector.
It also implements the Selector loop.| Modifier and Type | Class and Description |
|---|---|
private class |
NioDatagramWorker.ChannelRegistionTask
RegisterTask is a task responsible for registering a channel with a
selector.
|
| Modifier and Type | Field and Description |
|---|---|
private SocketReceiveBufferAllocator |
bufferAllocator |
sendBufferPoollogger, selector, startupLatch, thread, wakenUp| Constructor and Description |
|---|
NioDatagramWorker(java.util.concurrent.Executor executor)
Sole constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.Runnable |
createRegisterTask(Channel channel,
ChannelFuture future) |
(package private) static void |
disconnect(NioDatagramChannel channel,
ChannelFuture future) |
protected boolean |
read(java.nio.channels.SelectionKey key)
Read is called when a Selector has been notified that the underlying channel
was something to be read.
|
void |
run() |
protected boolean |
scheduleWriteIfNecessary(AbstractNioChannel<?> channel) |
protected void |
write0(AbstractNioChannel<?> channel) |
void |
writeFromUserCode(AbstractNioChannel<?> channel) |
cleanUpWriteBuffer, clearOpWrite, close, close, executeInIoThread, executeInIoThread, isIoThread, newThreadRenamingRunnable, process, setInterestOps, setOpWrite, writeFromSelectorLoop, writeFromTaskLoopcleanUpCancelledKeys, increaseCancelledKeys, isIoThread, rebuildSelector, register, registerTask, select, shutdownprivate final SocketReceiveBufferAllocator bufferAllocator
NioDatagramWorker(java.util.concurrent.Executor executor)
executor - the Executor used to execute Runnables
such as NioDatagramWorker.ChannelRegistionTaskprotected boolean read(java.nio.channels.SelectionKey key)
AbstractNioWorkerread in class AbstractNioWorkerkey - The selection key which contains the Selector registration information.protected boolean scheduleWriteIfNecessary(AbstractNioChannel<?> channel)
scheduleWriteIfNecessary in class AbstractNioWorkerstatic void disconnect(NioDatagramChannel channel, ChannelFuture future)
protected java.lang.Runnable createRegisterTask(Channel channel, ChannelFuture future)
createRegisterTask in class AbstractNioSelectorpublic void writeFromUserCode(AbstractNioChannel<?> channel)
writeFromUserCode in class AbstractNioWorkerprotected void write0(AbstractNioChannel<?> channel)
write0 in class AbstractNioWorkerpublic void run()
run in interface java.lang.Runnablerun in class AbstractNioWorker