Record Class NewRenoConfig
java.lang.Object
java.lang.Record
io.github.mahmoudimus.quic.congestion.NewRenoConfig
- Record Components:
initialWindow- the initial congestion window in bytes; RFC 9002 recommendsmin(10 * max_datagram_size, max(2 * max_datagram_size, 14720))lossReductionFactor- the factor the window is multiplied by on a congestion event, 0.5 in RFC 9002
- All Implemented Interfaces:
ControllerFactory
public record NewRenoConfig(long initialWindow, double lossReductionFactor)
extends Record
implements ControllerFactory
Configuration of the
NewReno controller.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final NewRenoConfigThe RFC 9002 defaults: a 12000-byte initial window and a loss reduction factor of 0.5. -
Constructor Summary
ConstructorsConstructorDescriptionNewRenoConfig(long initialWindow, double lossReductionFactor) A configuration. -
Method Summary
Modifier and TypeMethodDescriptionbuild(long now, int currentMtu) A new controller.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longReturns the value of theinitialWindowrecord component.doubleReturns the value of thelossReductionFactorrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DEFAULT
The RFC 9002 defaults: a 12000-byte initial window and a loss reduction factor of 0.5.
-
-
Constructor Details
-
NewRenoConfig
public NewRenoConfig(long initialWindow, double lossReductionFactor) A configuration.- Parameters:
initialWindow- the initial window, positivelossReductionFactor- the reduction factor, in (0, 1]
-
-
Method Details
-
build
Description copied from interface:ControllerFactoryA new controller.- Specified by:
buildin interfaceControllerFactory- Parameters:
now- the current time, in nanosecondscurrentMtu- the path's current maximum UDP payload size- Returns:
- the controller
-
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. All components in this record class are compared with '=='. -
initialWindow
public long initialWindow()Returns the value of theinitialWindowrecord component.- Returns:
- the value of the
initialWindowrecord component
-
lossReductionFactor
public double lossReductionFactor()Returns the value of thelossReductionFactorrecord component.- Returns:
- the value of the
lossReductionFactorrecord component
-