public class ReliableTcpConnection extends Object
| Modifier and Type | Class and Description |
|---|---|
(package private) class |
ReliableTcpConnection.AckTimerTask |
(package private) static class |
ReliableTcpConnection.NetOutputStream |
(package private) class |
ReliableTcpConnection.Reader |
(package private) static class |
ReliableTcpConnection.TcpMessage |
| Modifier and Type | Field and Description |
|---|---|
private BufferedInputStream |
bis |
static int |
CONNECT |
static int |
CONNECTING |
static int |
DEFAULT_WINDOW_SIZE |
static int |
INIT |
private long |
inputCounter |
private Object |
inputLock |
private static org.objectweb.util.monolog.api.Logger |
logger |
private boolean |
noAckedQueue |
private ReliableTcpConnection.NetOutputStream |
nos |
private long |
outputCounter |
private Object |
outputLock |
private Vector<ReliableTcpConnection.TcpMessage> |
pendingMessages |
private ReliableTcpConnection.Reader |
reader |
private LinkedBlockingQueue<byte[]> |
receiveQueue |
private Socket |
sock |
private int |
status |
private static String[] |
statusNames |
private Timer |
timer |
private int |
unackCounter
Counter of received messages that needs an acknowledge.
|
static String |
WINDOW_SIZE_PROP_NAME |
private int |
windowSize
Maximum number of non acknowledged messages
|
| Constructor and Description |
|---|
ReliableTcpConnection(Timer timer,
boolean noAckedQueue) |
| Modifier and Type | Method and Description |
|---|---|
private void |
ackPendingMessages(long ackId) |
private void |
addPendingMessage(ReliableTcpConnection.TcpMessage msg) |
void |
close() |
private void |
doSend(long id,
long ackId,
org.objectweb.joram.shared.client.AbstractJmsMessage msg) |
private int |
getStatus() |
void |
init(Socket sock) |
boolean |
isReaderRun() |
org.objectweb.joram.shared.client.AbstractJmsReply |
receive() |
void |
send(org.objectweb.joram.shared.client.AbstractJmsMessage request) |
private void |
setStatus(int status) |
private static final org.objectweb.util.monolog.api.Logger logger
public static final int INIT
public static final int CONNECT
public static final int CONNECTING
private static final String[] statusNames
public static String WINDOW_SIZE_PROP_NAME
public static int DEFAULT_WINDOW_SIZE
private int windowSize
private volatile int unackCounter
private volatile long inputCounter
private long outputCounter
private Vector<ReliableTcpConnection.TcpMessage> pendingMessages
private Socket sock
private ReliableTcpConnection.NetOutputStream nos
private BufferedInputStream bis
private Object inputLock
private Object outputLock
private int status
private Timer timer
private boolean noAckedQueue
private LinkedBlockingQueue<byte[]> receiveQueue
private ReliableTcpConnection.Reader reader
public ReliableTcpConnection(Timer timer, boolean noAckedQueue)
private void setStatus(int status)
private final int getStatus()
public void init(Socket sock) throws IOException
IOExceptionpublic void send(org.objectweb.joram.shared.client.AbstractJmsMessage request)
throws IOException
IOExceptionprivate void doSend(long id,
long ackId,
org.objectweb.joram.shared.client.AbstractJmsMessage msg)
throws IOException
IOExceptionprivate void addPendingMessage(ReliableTcpConnection.TcpMessage msg)
private void ackPendingMessages(long ackId)
public org.objectweb.joram.shared.client.AbstractJmsReply receive()
throws Exception
Exceptionpublic boolean isReaderRun()
public void close()
Copyright © 2023 ScalAgent D.T.. All rights reserved.