udt.packets
Class ControlPacket
java.lang.Object
udt.packets.ControlPacket
- All Implemented Interfaces:
- Comparable<UDTPacket>, UDTPacket
- Direct Known Subclasses:
- Acknowledgement, Acknowledgment2, ConnectionHandshake, KeepAlive, MessageDropRequest, NegativeAcknowledgement, Shutdown, UserDefined
public abstract class ControlPacket
- extends Object
- implements UDTPacket
controlPacketType
protected int controlPacketType
ackSequenceNumber
protected long ackSequenceNumber
messageNumber
protected long messageNumber
timeStamp
protected long timeStamp
destinationID
protected long destinationID
controlInformation
protected byte[] controlInformation
ControlPacket
public ControlPacket()
getControlPacketType
public int getControlPacketType()
- Specified by:
getControlPacketType in interface UDTPacket
getAckSequenceNumber
public long getAckSequenceNumber()
setAckSequenceNumber
public void setAckSequenceNumber(long ackSequenceNumber)
getMessageNumber
public long getMessageNumber()
- Specified by:
getMessageNumber in interface UDTPacket
setMessageNumber
public void setMessageNumber(long messageNumber)
- Specified by:
setMessageNumber in interface UDTPacket
getTimeStamp
public long getTimeStamp()
- Specified by:
getTimeStamp in interface UDTPacket
setTimeStamp
public void setTimeStamp(long timeStamp)
- Specified by:
setTimeStamp in interface UDTPacket
getDestinationID
public long getDestinationID()
- Specified by:
getDestinationID in interface UDTPacket
setDestinationID
public void setDestinationID(long destinationID)
- Specified by:
setDestinationID in interface UDTPacket
getHeader
public byte[] getHeader()
- return the header according to specification p.5
- Specified by:
getHeader in interface UDTPacket
- Returns:
encodeControlInformation
public abstract byte[] encodeControlInformation()
- this method builds the control information
from the control parameters
- Returns:
getEncoded
public byte[] getEncoded()
- complete header+ControlInformation packet for transmission
- Specified by:
getEncoded in interface UDTPacket
equals
public boolean equals(Object obj)
- Overrides:
equals in class Object
isControlPacket
public boolean isControlPacket()
- Specified by:
isControlPacket in interface UDTPacket
forSender
public boolean forSender()
- Description copied from interface:
UDTPacket
- return
true if this packet should be routed to
the UDTSender
- Specified by:
forSender in interface UDTPacket
- Returns:
isConnectionHandshake
public boolean isConnectionHandshake()
- Specified by:
isConnectionHandshake in interface UDTPacket
getSession
public UDTSession getSession()
- Specified by:
getSession in interface UDTPacket
setSession
public void setSession(UDTSession session)
getPacketSequenceNumber
public long getPacketSequenceNumber()
- Specified by:
getPacketSequenceNumber in interface UDTPacket
compareTo
public int compareTo(UDTPacket other)
- Specified by:
compareTo in interface Comparable<UDTPacket>
Copyright © 2013 LittleShoot. All Rights Reserved.