public class NioSender extends AbstractSender
| Modifier and Type | Field and Description |
|---|---|
protected XByteBuffer |
ackbuf |
protected boolean |
complete |
protected boolean |
connecting |
protected byte[] |
current |
protected java.nio.channels.DatagramChannel |
dataChannel |
protected java.nio.ByteBuffer |
readbuf |
protected int |
remaining |
protected java.nio.channels.Selector |
selector |
protected java.nio.channels.SocketChannel |
socketChannel |
protected java.nio.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() |
java.nio.channels.Selector |
getSelector() |
boolean |
isComplete() |
boolean |
process(java.nio.channels.SelectionKey key,
boolean waitForAck)
State machine to send data
|
protected boolean |
read(java.nio.channels.SelectionKey key) |
void |
reset() |
void |
setComplete(boolean complete) |
void |
setMessage(byte[] data)
sendMessage
|
void |
setMessage(byte[] data,
int offset,
int length) |
void |
setSelector(java.nio.channels.Selector selector) |
protected boolean |
write(java.nio.channels.SelectionKey key) |
getAddress, getAttempt, getConnectTime, getDestination, getDirect, 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, setDirect, setDirectBuffer, setKeepAliveCount, setKeepAliveTime, setMaxRetryAttempts, setOoBInline, setPort, setRequestCount, setRxBufSize, setSoKeepAlive, setSoLingerOn, setSoLingerTime, setSoReuseAddress, setSoTrafficClass, setTcpNoDelay, setThrowOnFailedAck, setTimeout, setTxBufSize, setUdpBased, setUdpPort, setUdpRxBufSize, setUdpTxBufSize, transferPropertiesprotected java.nio.channels.Selector selector
protected java.nio.channels.SocketChannel socketChannel
protected java.nio.channels.DatagramChannel dataChannel
protected java.nio.ByteBuffer readbuf
protected java.nio.ByteBuffer writebuf
protected volatile byte[] current
protected XByteBuffer ackbuf
protected int remaining
protected boolean complete
protected boolean connecting
public boolean process(java.nio.channels.SelectionKey key,
boolean waitForAck)
throws java.io.IOException
key - SelectionKeyjava.io.IOExceptionprotected boolean read(java.nio.channels.SelectionKey key)
throws java.io.IOException
java.io.IOExceptionprotected boolean write(java.nio.channels.SelectionKey key)
throws java.io.IOException
java.io.IOExceptionpublic void connect()
throws java.io.IOException
connect in interface DataSenderconnect in class AbstractSenderjava.io.IOException - TODO Implement this org.apache.catalina.tribes.transport.IDataSender methodpublic void disconnect()
disconnect in interface DataSenderdisconnect in class AbstractSenderpublic void reset()
public void setMessage(byte[] data)
throws java.io.IOException
data - ChannelMessagejava.io.IOException - TODO Implement this org.apache.catalina.tribes.transport.IDataSender methodpublic void setMessage(byte[] data,
int offset,
int length)
throws java.io.IOException
java.io.IOExceptionpublic byte[] getMessage()
public boolean isComplete()
public java.nio.channels.Selector getSelector()
public void setSelector(java.nio.channels.Selector selector)
public void setComplete(boolean complete)
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.