Class BioSender
java.lang.Object
org.apache.catalina.tribes.transport.AbstractSender
org.apache.catalina.tribes.transport.bio.BioSender
- All Implemented Interfaces:
- DataSender
Send cluster messages with only one socket. Ack and keep Alive Handling is
 supported
- Since:
- 5.5.16
- Author:
- Peter Rossbach
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final XByteBufferprotected static final StringManagerThe string manager for this package.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidClose socket.voidconnect()Connect other cluster member receivervoiddisconnect and close socketprotected voidOpen real socket and set time out when waitForAck is enabled is socket open return directly.protected voidpushMessage(byte[] data, boolean reconnect, boolean waitForAck) Push messages with only one socket at a time Wait for ack is needed and make auto retry when write message is failed.voidsendMessage(byte[] data, boolean waitForAck) Send message.toString()protected voidWait for Acknowledgement from other server.Methods inherited from class org.apache.catalina.tribes.transport.AbstractSendergetAddress, 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
- 
Field Details- 
smThe string manager for this package.
- 
ackbuf
 
- 
- 
Constructor Details- 
BioSenderpublic BioSender()
 
- 
- 
Method Details- 
connectConnect other cluster member receiver- Specified by:
- connectin interface- DataSender
- Specified by:
- connectin class- AbstractSender
- Throws:
- IOException- TODO Implement this org.apache.catalina.tribes.transport.DataSender method
- See Also:
 
- 
disconnectpublic void disconnect()disconnect and close socket- Specified by:
- disconnectin interface- DataSender
- Specified by:
- disconnectin class- AbstractSender
- See Also:
 
- 
sendMessageSend message.- Parameters:
- data- The data to send
- waitForAck- Wait for an ack
- Throws:
- IOException- An IO error occurred sending the message
 
- 
toString
- 
openSocketOpen real socket and set time out when waitForAck is enabled is socket open return directly.- Throws:
- IOException- Error opening socket
 
- 
closeSocketprotected void closeSocket()Close socket.- See Also:
 
- 
pushMessagePush messages with only one socket at a time Wait for ack is needed and make auto retry when write message is failed. After sending error close and reopen socket again. After successful sending update stats WARNING: Subclasses must be very careful that only one thread call this pushMessage at once!!!- Parameters:
- data- Data to send
- reconnect- Do a reconnect (close socket then reopen)
- waitForAck- Wait for an acknowledgement
- Throws:
- IOException- IO error writing data
- Since:
- 5.5.10
- See Also:
 
- 
waitForAckWait for Acknowledgement from other server. FIXME Please, not wait only for three characters, better control that the wait ack message is correct.- Throws:
- IOException- An IO error occurred
 
 
-