Class ReliableTcpConnection


  • public class ReliableTcpConnection
    extends Object
    • Field Detail

      • logger

        private static final Logger logger
      • DEBUG

        private static final boolean DEBUG
      • statusNames

        private static final String[] statusNames
      • windowSize

        private int windowSize
        Maximum number of non acknowledged messages
      • unackCounter

        private volatile int unackCounter
        Counter of received messages that needs an acknowledge. The messages received are acknowledged each time a message is sent (sending of the stamp of the last message received). This counter is incremented when a message is received, and reseted when a message is sent (acknowledgment of all messages received). When the number of messages waiting an acknowledgment is too high (windowSize) an empty message is sent to explicitly acknowledge them. TODO (AF): This field should be synchronized, currently collisions may occur during counter increments. The consequence is that the actual value of the counter may be less than the actual value. In the current implementation this is not a problem.
      • inputCounter

        private volatile long inputCounter
      • outputCounter

        private long outputCounter
      • inputLock

        private Object inputLock
      • outputLock

        private Object outputLock
      • status

        private int status
      • timer

        private Timer timer
      • noAckedQueue

        private boolean noAckedQueue
    • Constructor Detail

      • ReliableTcpConnection

        public ReliableTcpConnection​(Timer timer,
                                     boolean noAckedQueue)