Record Class RecoveryConfig
java.lang.Object
java.lang.Record
io.github.mahmoudimus.quic.connection.RecoveryConfig
- Record Components:
packetThreshold- packets acknowledged after a packet before it is deemed lost, 3 (RFC 9002 kPacketThreshold)timeThreshold- the RTT multiple after which an unacknowledged packet is deemed lost, 9/8 (RFC 9002 kTimeThreshold)initialRtt- the RTT assumed before a sample, 333 ms (RFC 9002 kInitialRtt)persistentCongestionThreshold- PTOs of loss that make persistent congestion, 3 (RFC 9002 kPersistentCongestionThreshold)initialMtu- the UDP payload size to start with, at least 1200minMtu- the UDP payload size the path is assumed to support, at least 1200mtuDiscovery- MTU discovery settings, or null to keep the MTU fixed atinitialMtucongestionControllerFactory- the congestion controller, CUBIC by defaultmaxOutgoingBytesPerSecond- a pacing rate limit, or -1 for nonemaxAckDelay- this endpoint'smax_ack_delay, 25 ms by default; also the peer's until its transport parameters arriveackDelayExponent- this endpoint'sack_delay_exponent, 3 by default
public record RecoveryConfig(int packetThreshold, double timeThreshold, long initialRtt, int persistentCongestionThreshold, int initialMtu, int minMtu, MtuDiscoveryConfig mtuDiscovery, ControllerFactory congestionControllerFactory, long maxOutgoingBytesPerSecond, long maxAckDelay, int ackDelayExponent)
extends Record
Configuration of loss detection, congestion control, pacing and MTU discovery. Durations are
nanoseconds. Immutable; build one with
builder().-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final RecoveryConfigThe defaults.static final intThe smallest MTU QUIC allows, 1200 bytes (RFC 9000 section 14). -
Constructor Summary
ConstructorsConstructorDescriptionRecoveryConfig(int packetThreshold, double timeThreshold, long initialRtt, int persistentCongestionThreshold, int initialMtu, int minMtu, MtuDiscoveryConfig mtuDiscovery, ControllerFactory congestionControllerFactory, long maxOutgoingBytesPerSecond, long maxAckDelay, int ackDelayExponent) A configuration. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theackDelayExponentrecord component.static RecoveryConfig.Builderbuilder()A builder with the defaults.Returns the value of thecongestionControllerFactoryrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of theinitialMturecord component.longReturns the value of theinitialRttrecord component.longReturns the value of themaxAckDelayrecord component.longReturns the value of themaxOutgoingBytesPerSecondrecord component.intminMtu()Returns the value of theminMturecord component.Returns the value of themtuDiscoveryrecord component.intReturns the value of thepacketThresholdrecord component.intReturns the value of thepersistentCongestionThresholdrecord component.doubleReturns the value of thetimeThresholdrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
MIN_MTU
public static final int MIN_MTUThe smallest MTU QUIC allows, 1200 bytes (RFC 9000 section 14).- See Also:
-
DEFAULT
The defaults.
-
-
Constructor Details
-
RecoveryConfig
public RecoveryConfig(int packetThreshold, double timeThreshold, long initialRtt, int persistentCongestionThreshold, int initialMtu, int minMtu, MtuDiscoveryConfig mtuDiscovery, ControllerFactory congestionControllerFactory, long maxOutgoingBytesPerSecond, long maxAckDelay, int ackDelayExponent) A configuration.- Parameters:
packetThreshold- the packet reordering threshold, at least 1timeThreshold- the time reordering threshold, above 1initialRtt- the initial RTT, positivepersistentCongestionThreshold- the persistent congestion threshold, at least 1initialMtu- the initial MTU, at leastminMtuminMtu- the minimum MTU, at least 1200mtuDiscovery- MTU discovery settings, or nullcongestionControllerFactory- the congestion controller factorymaxOutgoingBytesPerSecond- the rate limit, or -1maxAckDelay- ourmax_ack_delayackDelayExponent- ourack_delay_exponent, 0 to 20
-
-
Method Details
-
builder
A builder with the defaults.- Returns:
- the builder
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
packetThreshold
public int packetThreshold()Returns the value of thepacketThresholdrecord component.- Returns:
- the value of the
packetThresholdrecord component
-
timeThreshold
public double timeThreshold()Returns the value of thetimeThresholdrecord component.- Returns:
- the value of the
timeThresholdrecord component
-
initialRtt
public long initialRtt()Returns the value of theinitialRttrecord component.- Returns:
- the value of the
initialRttrecord component
-
persistentCongestionThreshold
public int persistentCongestionThreshold()Returns the value of thepersistentCongestionThresholdrecord component.- Returns:
- the value of the
persistentCongestionThresholdrecord component
-
initialMtu
public int initialMtu()Returns the value of theinitialMturecord component.- Returns:
- the value of the
initialMturecord component
-
minMtu
public int minMtu()Returns the value of theminMturecord component.- Returns:
- the value of the
minMturecord component
-
mtuDiscovery
Returns the value of themtuDiscoveryrecord component.- Returns:
- the value of the
mtuDiscoveryrecord component
-
congestionControllerFactory
Returns the value of thecongestionControllerFactoryrecord component.- Returns:
- the value of the
congestionControllerFactoryrecord component
-
maxOutgoingBytesPerSecond
public long maxOutgoingBytesPerSecond()Returns the value of themaxOutgoingBytesPerSecondrecord component.- Returns:
- the value of the
maxOutgoingBytesPerSecondrecord component
-
maxAckDelay
public long maxAckDelay()Returns the value of themaxAckDelayrecord component.- Returns:
- the value of the
maxAckDelayrecord component
-
ackDelayExponent
public int ackDelayExponent()Returns the value of theackDelayExponentrecord component.- Returns:
- the value of the
ackDelayExponentrecord component
-