java.lang.Object
net.i2p.router.Tuner.BaseParam
net.i2p.router.Tuner.ConnectTimeoutMultiplierParam
All Implemented Interfaces:
Tuner.TunableParam
Enclosing class:
Tuner

private class Tuner.ConnectTimeoutMultiplierParamextends Tuner.BaseParam
Tunes connect timeout multiplier based on observed RTT. Scales each client's desired connect timeout so low-latency paths fail fast and high-latency paths have enough time for SYN retransmits. Multiplier range: 30-200 (0.3x-2.0x), centered on 100 (1.0x) at RTO=5000. Target: RTO / 5000 * 100, i.e. proportional to the dynamic initial RTO.
  • Constructor Details

    • ConnectTimeoutMultiplierParam

      ConnectTimeoutMultiplierParam()
      Creates the parameter that scales the connect timeout, 30 to 200 percent.
  • Method Details

    • applyValue

      protected void applyValue(int value)
      Apply to Connection's static multiplier, clamped to [50,200].
      Specified by:
      applyValue in class Tuner.BaseParam
      Parameters:
      value - the tunable value to apply to router configuration
    • getRuntimeValue

      protected int getRuntimeValue()
      Read current multiplier from Connection.
      Specified by:
      getRuntimeValue in class Tuner.BaseParam
      Returns:
      current runtime value read from router config
    • getObservedStat

      protected double getObservedStat(RouterContext ctx)
      Read RTT stat as the basis for multiplier computation.
      Specified by:
      getObservedStat in class Tuner.BaseParam
      Parameters:
      ctx - router context, never null
      Returns:
      observed stat value for autotuning
    • computeTarget

      protected int computeTarget(double observed)
      Compute multiplier: proportional to current RTO with a floor/ceiling.
      Specified by:
      computeTarget in class Tuner.BaseParam
      Parameters:
      observed - current stat value
      Returns:
      target tunable value