public class ChannelWorker extends java.lang.Object implements Worker
Selector to generate read, write, and connect events from registered Channels.
The single selector manages multiple channels - as many as you want to read from with a single thread.
Channel events are dispatched to the EventHandler provided in the register call.
Write events are only generated if a write command fails to write all the bytes to the socket. This should be a rare occurrence.
| Constructor and Description |
|---|
ChannelWorker() |
| Modifier and Type | Method and Description |
|---|---|
void |
doWork() |
void |
notifyPendingWrite(java.nio.channels.SocketChannel channel) |
void |
register(java.nio.channels.SocketChannel channel,
EventHandler eventHandler) |
public void register(java.nio.channels.SocketChannel channel,
EventHandler eventHandler)
public void notifyPendingWrite(java.nio.channels.SocketChannel channel)