public class NioReplicationTask extends AbstractRxTask
Modifier and Type | Field and Description |
---|---|
protected static StringManager |
sm |
OPTION_DIRECT_BUFFER, useBufferPool
Constructor and Description |
---|
NioReplicationTask(ListenCallback callback,
NioReceiver receiver) |
Modifier and Type | Method and Description |
---|---|
protected void |
drainChannel(SelectionKey key,
ObjectReader reader)
The actual code which drains the channel associated with
the given key.
|
int |
getRxBufSize() |
protected void |
registerForRead(SelectionKey key,
ObjectReader reader) |
void |
run() |
protected void |
sendAck(SelectionKey key,
WritableByteChannel channel,
byte[] command,
SocketAddress udpaddr)
Send a reply-acknowledgement (6,2,3), sends it doing a busy write, the ACK is so small
that it should always go to the buffer.
|
void |
serviceChannel(SelectionKey key)
Called to initiate a unit of work by this worker thread
on the provided SelectionKey object.
|
void |
setRxBufSize(int rxBufSize) |
close, getCallback, getOptions, getTaskPool, getUseBufferPool, isDoRun, setCallback, setDoRun, setOptions, setTaskPool, setUseBufferPool
protected static final StringManager sm
public NioReplicationTask(ListenCallback callback, NioReceiver receiver)
public void run()
public void serviceChannel(SelectionKey key)
key
- The key to processprotected void drainChannel(SelectionKey key, ObjectReader reader) throws Exception
key
- The key to processreader
- The readerException
- IO errorprotected void registerForRead(SelectionKey key, ObjectReader reader)
protected void sendAck(SelectionKey key, WritableByteChannel channel, byte[] command, SocketAddress udpaddr)
key
- The key to usechannel
- The channelcommand
- The command to writeudpaddr
- Target addresspublic void setRxBufSize(int rxBufSize)
public int getRxBufSize()
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.