Package net.rudp
Class ReliableSocketProfile
- java.lang.Object
-
- net.rudp.ReliableSocketProfile
-
public class ReliableSocketProfile extends java.lang.Object
This class specifies the RUDP parameters of a socket.- Author:
- Adrian Granados
- See Also:
ReliableSocket
-
-
Field Summary
Fields Modifier and Type Field Description static int
CUMULATIVE_ACK_TIMEOUT
static int
MAX_AUTO_RESET
static int
MAX_CUMULATIVE_ACKS
static int
MAX_OUT_OF_SEQUENCE
static int
MAX_OUTSTANDING_SEGS
static int
MAX_RECV_QUEUE_SIZE
static int
MAX_RETRANS
static int
MAX_SEGMENT_SIZE
static int
MAX_SEND_QUEUE_SIZE
static int
NULL_SEGMENT_TIMEOUT
static int
RETRANSMISSION_TIMEOUT
-
Constructor Summary
Constructors Constructor Description ReliableSocketProfile()
Creates a profile with the default RUDP parameter values.ReliableSocketProfile(int maxSendQueueSize, int maxRecvQueueSize, int maxSegmentSize, int maxOutstandingSegs, int maxRetrans, int maxCumulativeAcks, int maxOutOfSequence, int maxAutoReset, int nullSegmentTimeout, int retransmissionTimeout, int cumulativeAckTimeout)
Creates an profile with the specified RUDP parameter values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
cumulativeAckTimeout()
Returns the cumulative acknowledge timeout (ms).int
maxAutoReset()
Returns the maximum number of consecutive auto resets.int
maxCumulativeAcks()
Returns the maximum number of unacknowledged received segments.int
maxOutOfSequence()
Returns the maximum number of out-of-sequence received segments.int
maxOutstandingSegs()
Returns the maximum number of outstanding segments.int
maxRecvQueueSize()
Returns the maximum receive queue size (packets).int
maxRetrans()
Returns the maximum number of consecutive retransmissions (0 means unlimited).int
maxSegmentSize()
Returns the maximum segment size (octets).int
maxSendQueueSize()
Returns the maximum send queue size (packets).int
nullSegmentTimeout()
Returns the null segment timeout (ms).int
retransmissionTimeout()
Returns the retransmission timeout (ms).java.lang.String
toString()
-
-
-
Field Detail
-
MAX_SEND_QUEUE_SIZE
public static final int MAX_SEND_QUEUE_SIZE
- See Also:
- Constant Field Values
-
MAX_RECV_QUEUE_SIZE
public static final int MAX_RECV_QUEUE_SIZE
- See Also:
- Constant Field Values
-
MAX_SEGMENT_SIZE
public static final int MAX_SEGMENT_SIZE
- See Also:
- Constant Field Values
-
MAX_OUTSTANDING_SEGS
public static final int MAX_OUTSTANDING_SEGS
- See Also:
- Constant Field Values
-
MAX_RETRANS
public static final int MAX_RETRANS
- See Also:
- Constant Field Values
-
MAX_CUMULATIVE_ACKS
public static final int MAX_CUMULATIVE_ACKS
- See Also:
- Constant Field Values
-
MAX_OUT_OF_SEQUENCE
public static final int MAX_OUT_OF_SEQUENCE
- See Also:
- Constant Field Values
-
MAX_AUTO_RESET
public static final int MAX_AUTO_RESET
- See Also:
- Constant Field Values
-
NULL_SEGMENT_TIMEOUT
public static final int NULL_SEGMENT_TIMEOUT
- See Also:
- Constant Field Values
-
RETRANSMISSION_TIMEOUT
public static final int RETRANSMISSION_TIMEOUT
- See Also:
- Constant Field Values
-
CUMULATIVE_ACK_TIMEOUT
public static final int CUMULATIVE_ACK_TIMEOUT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ReliableSocketProfile
public ReliableSocketProfile()
Creates a profile with the default RUDP parameter values. Note: According to the RUDP protocol's draft, the default maximum number of retransmissions is 3. However, if packet drops are too high, the connection may get stall unless the sender continues to retransmit packets that have not been unacknowledged. We will use 0 instead, which means unlimited.
-
ReliableSocketProfile
public ReliableSocketProfile(int maxSendQueueSize, int maxRecvQueueSize, int maxSegmentSize, int maxOutstandingSegs, int maxRetrans, int maxCumulativeAcks, int maxOutOfSequence, int maxAutoReset, int nullSegmentTimeout, int retransmissionTimeout, int cumulativeAckTimeout)
Creates an profile with the specified RUDP parameter values.- Parameters:
maxSendQueueSize
- maximum send queue size (packets).maxRecvQueueSize
- maximum receive queue size (packets).maxSegmentSize
- maximum segment size (octets) (must be at least 22).maxOutstandingSegs
- maximum number of outstanding segments.maxRetrans
- maximum number of consecutive retransmissions (0 means unlimited).maxCumulativeAcks
- maximum number of unacknowledged received segments.maxOutOfSequence
- maximum number of out-of-sequence received segments.maxAutoReset
- maximum number of consecutive auto resets (not used).nullSegmentTimeout
- null segment timeout (ms).retransmissionTimeout
- retransmission timeout (ms).cumulativeAckTimeout
- cumulative acknowledge timeout (ms).
-
-
Method Detail
-
maxSendQueueSize
public int maxSendQueueSize()
Returns the maximum send queue size (packets).
-
maxRecvQueueSize
public int maxRecvQueueSize()
Returns the maximum receive queue size (packets).
-
maxSegmentSize
public int maxSegmentSize()
Returns the maximum segment size (octets).
-
maxOutstandingSegs
public int maxOutstandingSegs()
Returns the maximum number of outstanding segments.
-
maxRetrans
public int maxRetrans()
Returns the maximum number of consecutive retransmissions (0 means unlimited).
-
maxCumulativeAcks
public int maxCumulativeAcks()
Returns the maximum number of unacknowledged received segments.
-
maxOutOfSequence
public int maxOutOfSequence()
Returns the maximum number of out-of-sequence received segments.
-
maxAutoReset
public int maxAutoReset()
Returns the maximum number of consecutive auto resets.
-
nullSegmentTimeout
public int nullSegmentTimeout()
Returns the null segment timeout (ms).
-
retransmissionTimeout
public int retransmissionTimeout()
Returns the retransmission timeout (ms).
-
cumulativeAckTimeout
public int cumulativeAckTimeout()
Returns the cumulative acknowledge timeout (ms).
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-