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 |
static org.objectweb.util.monolog.api.Logger |
logger |
private boolean |
noAckedQueue |
private ReliableTcpConnection.NetOutputStream |
nos |
private long |
outputCounter |
private Object |
outputLock |
private Vector |
pendingMessages |
private ReliableTcpConnection.Reader |
reader |
private LinkedBlockingQueue<byte[]> |
receiveQueue |
private Socket |
sock |
private int |
status |
static String[] |
statusNames |
private Timer |
timer |
private int |
unackCounter |
static String |
WINDOW_SIZE_PROP_NAME |
private int |
windowSize |
Constructor and Description |
---|
ReliableTcpConnection(Timer timer2,
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,
AbstractJmsMessage msg) |
private int |
getStatus() |
void |
init(Socket sock) |
boolean |
isReaderRun() |
AbstractJmsReply |
receive() |
void |
send(AbstractJmsMessage request) |
private void |
setStatus(int status) |
public static final int INIT
public static final int CONNECT
public static final int CONNECTING
public static final String[] statusNames
public static org.objectweb.util.monolog.api.Logger logger
public static String WINDOW_SIZE_PROP_NAME
public static int DEFAULT_WINDOW_SIZE
private int windowSize
private volatile long inputCounter
private long outputCounter
private volatile int unackCounter
private Vector 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 timer2, boolean noAckedQueue)
private void setStatus(int status)
private final int getStatus()
public void init(Socket sock) throws IOException
IOException
public void send(AbstractJmsMessage request) throws IOException
IOException
private void doSend(long id, long ackId, AbstractJmsMessage msg) throws IOException
IOException
private void addPendingMessage(ReliableTcpConnection.TcpMessage msg)
private void ackPendingMessages(long ackId)
public AbstractJmsReply receive() throws Exception
Exception
public boolean isReaderRun()
public void close()
Copyright © 2016 ScalAgent D.T.. All Rights Reserved.