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 1200
minMtu - the UDP payload size the path is assumed to support, at least 1200
mtuDiscovery - MTU discovery settings, or null to keep the MTU fixed at initialMtu
congestionControllerFactory - the congestion controller, CUBIC by default
maxOutgoingBytesPerSecond - a pacing rate limit, or -1 for none
maxAckDelay - this endpoint's max_ack_delay, 25 ms by default; also the peer's until its transport parameters arrive
ackDelayExponent - this endpoint's ack_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().
  • Field Details

    • MIN_MTU

      public static final int MIN_MTU
      The smallest MTU QUIC allows, 1200 bytes (RFC 9000 section 14).
      See Also:
    • DEFAULT

      public static final RecoveryConfig 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 1
      timeThreshold - the time reordering threshold, above 1
      initialRtt - the initial RTT, positive
      persistentCongestionThreshold - the persistent congestion threshold, at least 1
      initialMtu - the initial MTU, at least minMtu
      minMtu - the minimum MTU, at least 1200
      mtuDiscovery - MTU discovery settings, or null
      congestionControllerFactory - the congestion controller factory
      maxOutgoingBytesPerSecond - the rate limit, or -1
      maxAckDelay - our max_ack_delay
      ackDelayExponent - our ack_delay_exponent, 0 to 20
  • Method Details

    • builder

      public static RecoveryConfig.Builder builder()
      A builder with the defaults.
      Returns:
      the builder
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • packetThreshold

      public int packetThreshold()
      Returns the value of the packetThreshold record component.
      Returns:
      the value of the packetThreshold record component
    • timeThreshold

      public double timeThreshold()
      Returns the value of the timeThreshold record component.
      Returns:
      the value of the timeThreshold record component
    • initialRtt

      public long initialRtt()
      Returns the value of the initialRtt record component.
      Returns:
      the value of the initialRtt record component
    • persistentCongestionThreshold

      public int persistentCongestionThreshold()
      Returns the value of the persistentCongestionThreshold record component.
      Returns:
      the value of the persistentCongestionThreshold record component
    • initialMtu

      public int initialMtu()
      Returns the value of the initialMtu record component.
      Returns:
      the value of the initialMtu record component
    • minMtu

      public int minMtu()
      Returns the value of the minMtu record component.
      Returns:
      the value of the minMtu record component
    • mtuDiscovery

      public MtuDiscoveryConfig mtuDiscovery()
      Returns the value of the mtuDiscovery record component.
      Returns:
      the value of the mtuDiscovery record component
    • congestionControllerFactory

      public ControllerFactory congestionControllerFactory()
      Returns the value of the congestionControllerFactory record component.
      Returns:
      the value of the congestionControllerFactory record component
    • maxOutgoingBytesPerSecond

      public long maxOutgoingBytesPerSecond()
      Returns the value of the maxOutgoingBytesPerSecond record component.
      Returns:
      the value of the maxOutgoingBytesPerSecond record component
    • maxAckDelay

      public long maxAckDelay()
      Returns the value of the maxAckDelay record component.
      Returns:
      the value of the maxAckDelay record component
    • ackDelayExponent

      public int ackDelayExponent()
      Returns the value of the ackDelayExponent record component.
      Returns:
      the value of the ackDelayExponent record component