udt
Class UDTReceiver

java.lang.Object
  extended by udt.UDTReceiver

public class UDTReceiver
extends Object

receiver part of a UDT entity

See Also:
UDTSender

Field Summary
static boolean connectionExpiryDisabled
          if set to true connections will not expire, but will only be closed by a Shutdown message
static int dropRate
           
 
Constructor Summary
UDTReceiver(UDTSession session, UDPEndPoint endpoint)
          create a receiver with a valid UDTSession
 
Method Summary
protected  void onAck2PacketReceived(Acknowledgment2 ack2)
          spec p.
protected  void onDataPacketReceived(DataPacket dp)
           
protected  void onShutdown()
           
protected  void processACKEvent(boolean isTriggeredByTimer)
          process ACK event (see spec.
protected  void processEXPEvent()
          process EXP event (see spec.
protected  void processNAKEvent()
          process NAK event (see spec.
protected  void processUDTPacket(UDTPacket p)
           
protected  void receive(UDTPacket p)
           
 void receiverAlgorithm()
          receiver algorithm see specification P11.
protected  void resetEXPCount()
           
protected  void resetEXPTimer()
           
protected  long sendAcknowledgment(long ackNumber)
           
protected  void sendKeepAlive()
           
protected  long sendLightAcknowledgment(long ackNumber)
           
protected  void sendNAK(List<Long> sequenceNumbers)
           
protected  void sendNAK(long currentSequenceNumber)
          write a NAK triggered by a received sequence number that is larger than the largestReceivedSeqNumber + 1
protected  void sendShutdown()
           
 void setAckInterval(long ackInterval)
           
 void stop()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

connectionExpiryDisabled

public static boolean connectionExpiryDisabled
if set to true connections will not expire, but will only be closed by a Shutdown message


dropRate

public static int dropRate
Constructor Detail

UDTReceiver

public UDTReceiver(UDTSession session,
                   UDPEndPoint endpoint)
create a receiver with a valid UDTSession

Parameters:
session -
Method Detail

receive

protected void receive(UDTPacket p)
                throws IOException
Throws:
IOException

receiverAlgorithm

public void receiverAlgorithm()
                       throws InterruptedException,
                              IOException
receiver algorithm see specification P11.

Throws:
InterruptedException
IOException

processACKEvent

protected void processACKEvent(boolean isTriggeredByTimer)
                        throws IOException
process ACK event (see spec. p 12)

Throws:
IOException

processNAKEvent

protected void processNAKEvent()
                        throws IOException
process NAK event (see spec. p 13)

Throws:
IOException

processEXPEvent

protected void processEXPEvent()
                        throws IOException
process EXP event (see spec. p 13)

Throws:
IOException

processUDTPacket

protected void processUDTPacket(UDTPacket p)
                         throws IOException
Throws:
IOException

onDataPacketReceived

protected void onDataPacketReceived(DataPacket dp)
                             throws IOException
Throws:
IOException

sendNAK

protected void sendNAK(long currentSequenceNumber)
                throws IOException
write a NAK triggered by a received sequence number that is larger than the largestReceivedSeqNumber + 1

Parameters:
currentSequenceNumber - - the currently received sequence number
Throws:
IOException

sendNAK

protected void sendNAK(List<Long> sequenceNumbers)
                throws IOException
Throws:
IOException

sendLightAcknowledgment

protected long sendLightAcknowledgment(long ackNumber)
                                throws IOException
Throws:
IOException

sendAcknowledgment

protected long sendAcknowledgment(long ackNumber)
                           throws IOException
Throws:
IOException

onAck2PacketReceived

protected void onAck2PacketReceived(Acknowledgment2 ack2)
spec p. 13:
1) Locate the related ACK in the ACK History Window according to the ACK sequence number in this ACK2.
2) Update the largest ACK number ever been acknowledged.
3) Calculate new rtt according to the ACK2 arrival time and the ACK departure time, and update the RTT value as: RTT = (RTT * 7 + rtt) / 8.
4) Update RTTVar by: RTTVar = (RTTVar * 3 + abs(RTT - rtt)) / 4.
5) Update both ACK and NAK period to 4 * RTT + RTTVar + SYN.


sendKeepAlive

protected void sendKeepAlive()
                      throws IOException
Throws:
IOException

sendShutdown

protected void sendShutdown()
                     throws IOException
Throws:
IOException

resetEXPTimer

protected void resetEXPTimer()

resetEXPCount

protected void resetEXPCount()

setAckInterval

public void setAckInterval(long ackInterval)

onShutdown

protected void onShutdown()
                   throws IOException
Throws:
IOException

stop

public void stop()
          throws IOException
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013 LittleShoot. All Rights Reserved.