udt.packets
Class NegativeAcknowledgement

java.lang.Object
  extended by udt.packets.ControlPacket
      extended by udt.packets.NegativeAcknowledgement
All Implemented Interfaces:
Comparable<UDTPacket>, UDTPacket

public class NegativeAcknowledgement
extends ControlPacket

NAK carries information about lost packets loss info is described in the spec on p.15


Nested Class Summary
 
Nested classes/interfaces inherited from class udt.packets.ControlPacket
ControlPacket.ControlPacketType
 
Field Summary
 
Fields inherited from class udt.packets.ControlPacket
ackSequenceNumber, controlInformation, controlPacketType, destinationID, messageNumber, timeStamp
 
Constructor Summary
NegativeAcknowledgement()
           
NegativeAcknowledgement(byte[] controlInformation)
           
 
Method Summary
 void addLossInfo(List<Long> sequenceNumbers)
          pack the given list of sequence numbers and add them to the loss info
 void addLossInfo(long singleSequenceNumber)
          add a single lost packet number
 void addLossInfo(long firstSequenceNumber, long lastSequenceNumber)
          add an interval of lost packet numbers
 byte[] encodeControlInformation()
          this method builds the control information from the control parameters
 boolean equals(Object obj)
           
 List<Integer> getDecodedLossInfo()
          Return the lost packet numbers
 
Methods inherited from class udt.packets.ControlPacket
compareTo, forSender, getAckSequenceNumber, getControlPacketType, getDestinationID, getEncoded, getHeader, getMessageNumber, getPacketSequenceNumber, getSession, getTimeStamp, isConnectionHandshake, isControlPacket, setAckSequenceNumber, setDestinationID, setMessageNumber, setSession, setTimeStamp
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NegativeAcknowledgement

public NegativeAcknowledgement()

NegativeAcknowledgement

public NegativeAcknowledgement(byte[] controlInformation)
Method Detail

addLossInfo

public void addLossInfo(long singleSequenceNumber)
add a single lost packet number

Parameters:
singleSequenceNumber -

addLossInfo

public void addLossInfo(long firstSequenceNumber,
                        long lastSequenceNumber)
add an interval of lost packet numbers

Parameters:
firstSequenceNumber -
lastSequenceNumber -

addLossInfo

public void addLossInfo(List<Long> sequenceNumbers)
pack the given list of sequence numbers and add them to the loss info

Parameters:
sequenceNumbers - - a list of sequence numbers

getDecodedLossInfo

public List<Integer> getDecodedLossInfo()
Return the lost packet numbers

Returns:

encodeControlInformation

public byte[] encodeControlInformation()
Description copied from class: ControlPacket
this method builds the control information from the control parameters

Specified by:
encodeControlInformation in class ControlPacket
Returns:

equals

public boolean equals(Object obj)
Overrides:
equals in class ControlPacket


Copyright © 2013 LittleShoot. All Rights Reserved.