예제 #1
0
        protected long sendAcknowledgment(long ackNumber)
        {
            Acknowledgement acknowledgmentPkt = buildLightAcknowledgement(ackNumber);

            //set the estimate link capacity
            estimateLinkCapacity = packetPairWindow.getEstimatedLinkCapacity();
            acknowledgmentPkt.EstimatedLinkCapacity = (estimateLinkCapacity);
            //set the packet arrival rate
            packetArrivalSpeed = packetHistoryWindow.getPacketArrivalSpeed();
            acknowledgmentPkt.PacketReceiveRate = (packetArrivalSpeed);

            endpoint.DoSend(acknowledgmentPkt);

            statistics.incNumberOfACKSent();
            statistics.setPacketArrivalRate(packetArrivalSpeed, estimateLinkCapacity);
            return(acknowledgmentPkt.AckSequenceNumber);
        }
예제 #2
0
        protected long sendAcknowledgment(long ackNumber)
        {
            try
            {
                Acknowledgement acknowledgmentPkt = buildLightAcknowledgement(ackNumber);
                //set the estimate link capacity
                estimateLinkCapacity = packetPairWindow.getEstimatedLinkCapacity();
                acknowledgmentPkt.setEstimatedLinkCapacity(estimateLinkCapacity);
                //set the packet arrival rate
                packetArrivalSpeed = packetHistoryWindow.getPacketArrivalSpeed();
                acknowledgmentPkt.setPacketReceiveRate(packetArrivalSpeed);

                endpoint.doSend(acknowledgmentPkt);

                statistics.incNumberOfACKSent();
                statistics.setPacketArrivalRate(packetArrivalSpeed, estimateLinkCapacity);
                return(acknowledgmentPkt.getAckSequenceNumber());
            }
            catch (Exception exc)
            {
                Log.Write(this.ToString(), exc);
                return(0);
            }
        }