public class NioSender extends AbstractSender
Modifier and Type | Field and Description |
---|---|
protected XByteBuffer |
ackbuf |
protected boolean |
complete |
protected boolean |
connecting |
protected byte[] |
current |
protected DatagramChannel |
dataChannel |
protected ByteBuffer |
readbuf |
protected int |
remaining |
protected Selector |
selector |
protected static StringManager |
sm |
protected SocketChannel |
socketChannel |
protected ByteBuffer |
writebuf |
Constructor and Description |
---|
NioSender() |
Modifier and Type | Method and Description |
---|---|
void |
connect()
connect - blocking in this operation
|
void |
disconnect()
disconnect
TODO Implement this org.apache.catalina.tribes.transport.IDataSender method
|
byte[] |
getMessage() |
Selector |
getSelector() |
boolean |
isComplete() |
boolean |
process(SelectionKey key,
boolean waitForAck)
State machine to send data.
|
protected boolean |
read() |
void |
reset() |
void |
setComplete(boolean complete) |
void |
setMessage(byte[] data)
sendMessage
|
void |
setMessage(byte[] data,
int offset,
int length) |
void |
setSelector(Selector selector) |
protected boolean |
write() |
getAddress, getAttempt, getConnectTime, getDestination, getDirectBuffer, getKeepAliveCount, getKeepAliveTime, getMaxRetryAttempts, getOoBInline, getPort, getRequestCount, getRxBufSize, getSoKeepAlive, getSoLingerOn, getSoLingerTime, getSoReuseAddress, getSoTrafficClass, getTcpNoDelay, getThrowOnFailedAck, getTimeout, getTxBufSize, getUdpPort, getUdpRxBufSize, getUdpTxBufSize, isConnected, isUdpBased, keepalive, setAddress, setAttempt, setConnected, setConnectTime, setDestination, setDirectBuffer, setKeepAliveCount, setKeepAliveTime, setMaxRetryAttempts, setOoBInline, setPort, setRequestCount, setRxBufSize, setSoKeepAlive, setSoLingerOn, setSoLingerTime, setSoReuseAddress, setSoTrafficClass, setTcpNoDelay, setThrowOnFailedAck, setTimeout, setTxBufSize, setUdpBased, setUdpPort, setUdpRxBufSize, setUdpTxBufSize, transferProperties
protected static final StringManager sm
protected Selector selector
protected SocketChannel socketChannel
protected DatagramChannel dataChannel
protected ByteBuffer readbuf
protected ByteBuffer writebuf
protected volatile byte[] current
protected final XByteBuffer ackbuf
protected int remaining
protected boolean complete
protected boolean connecting
public boolean process(SelectionKey key, boolean waitForAck) throws IOException
key
- The key to usewaitForAck
- Wait for an acktrue
if the processing was successfulIOException
- An IO error occurredprotected boolean read() throws IOException
IOException
protected boolean write() throws IOException
IOException
public void connect() throws IOException
connect
in interface DataSender
connect
in class AbstractSender
IOException
- TODO Implement this org.apache.catalina.tribes.transport.IDataSender methodpublic void disconnect()
disconnect
in interface DataSender
disconnect
in class AbstractSender
public void reset()
public void setMessage(byte[] data) throws IOException
data
- ChannelMessageIOException
- TODO Implement this org.apache.catalina.tribes.transport.IDataSender methodpublic void setMessage(byte[] data, int offset, int length) throws IOException
IOException
public byte[] getMessage()
public boolean isComplete()
public Selector getSelector()
public void setSelector(Selector selector)
public void setComplete(boolean complete)
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.