Class QuicConfig


@Unstable public class QuicConfig extends TransportConfig
Quic transport options.
Author:
Julien Viet
  • Field Details

    • DEFAULT_MAX_INITIAL_DATA

      public static final long DEFAULT_MAX_INITIAL_DATA
      See Also:
    • DEFAULT_MAX_STREAM_DATA_BIDI_LOCAL

      public static final long DEFAULT_MAX_STREAM_DATA_BIDI_LOCAL
      See Also:
    • DEFAULT_MAX_STREAM_DATA_BIDI_REMOTE

      public static final long DEFAULT_MAX_STREAM_DATA_BIDI_REMOTE
      See Also:
    • DEFAULT_MAX_STREAMS_DATA_UNI

      public static final long DEFAULT_MAX_STREAMS_DATA_UNI
      See Also:
    • DEFAULT_MAX_STREAMS_DATA_BIDI

      public static final long DEFAULT_MAX_STREAMS_DATA_BIDI
      See Also:
    • DEFAULT_MAX_STREAM_DATA_UNI

      public static final long DEFAULT_MAX_STREAM_DATA_UNI
      See Also:
    • DEFAULT_DISABLE_ACTIVE_MIGRATION

      public static final boolean DEFAULT_DISABLE_ACTIVE_MIGRATION
      See Also:
    • DEFAULT_CLIENT_MAX_INITIAL_DATA

      public static final long DEFAULT_CLIENT_MAX_INITIAL_DATA
      See Also:
    • DEFAULT_CLIENT_MAX_STREAM_DATA_BIDI_LOCAL

      public static final long DEFAULT_CLIENT_MAX_STREAM_DATA_BIDI_LOCAL
      See Also:
    • DEFAULT_CLIENT_MAX_STREAM_DATA_BIDI_REMOTE

      public static final long DEFAULT_CLIENT_MAX_STREAM_DATA_BIDI_REMOTE
      See Also:
    • DEFAULT_CLIENT_MAX_STREAMS_DATA_UNI

      public static final long DEFAULT_CLIENT_MAX_STREAMS_DATA_UNI
      See Also:
    • DEFAULT_CLIENT_MAX_STREAMS_DATA_BIDI

      public static final long DEFAULT_CLIENT_MAX_STREAMS_DATA_BIDI
      See Also:
    • DEFAULT_CLIENT_MAX_STREAM_DATA_UNI

      public static final long DEFAULT_CLIENT_MAX_STREAM_DATA_UNI
      See Also:
    • DEFAULT_CLIENT_DISABLE_ACTIVE_MIGRATION

      public static final boolean DEFAULT_CLIENT_DISABLE_ACTIVE_MIGRATION
      See Also:
    • DEFAULT_SERVER_MAX_INITIAL_DATA

      public static final long DEFAULT_SERVER_MAX_INITIAL_DATA
      See Also:
    • DEFAULT_SERVER_MAX_STREAM_DATA_BIDI_LOCAL

      public static final long DEFAULT_SERVER_MAX_STREAM_DATA_BIDI_LOCAL
      See Also:
    • DEFAULT_SERVER_MAX_STREAM_DATA_BIDI_REMOTE

      public static final long DEFAULT_SERVER_MAX_STREAM_DATA_BIDI_REMOTE
      See Also:
    • DEFAULT_SERVER_MAX_STREAMS_DATA_UNI

      public static final long DEFAULT_SERVER_MAX_STREAMS_DATA_UNI
      See Also:
    • DEFAULT_SERVER_MAX_STREAMS_DATA_BIDI

      public static final long DEFAULT_SERVER_MAX_STREAMS_DATA_BIDI
      See Also:
    • DEFAULT_SERVER_MAX_STREAM_DATA_UNI

      public static final long DEFAULT_SERVER_MAX_STREAM_DATA_UNI
      See Also:
    • DEFAULT_SERVER_DISABLE_ACTIVE_MIGRATION

      public static final boolean DEFAULT_SERVER_DISABLE_ACTIVE_MIGRATION
      See Also:
    • DEFAULT_MAX_IDLE_TIMEOUT

      public static final Duration DEFAULT_MAX_IDLE_TIMEOUT
    • DEFAULT_MAX_ACK_DELAY

      public static final Duration DEFAULT_MAX_ACK_DELAY
    • DEFAULT_ACK_DELAY_EXPONENT

      public static final int DEFAULT_ACK_DELAY_EXPONENT
      See Also:
    • DEFAULT_CONGESTION_CONTROL_ALGORITHM

      public static final QuicCongestionControlAlgorithm DEFAULT_CONGESTION_CONTROL_ALGORITHM
    • DEFAULT_GREASE

      public static final boolean DEFAULT_GREASE
      See Also:
    • DEFAULT_HYSTART

      public static final boolean DEFAULT_HYSTART
      See Also:
    • DEFAULT_INITIAL_CONGESTION_WINDOW_PACKETS

      public static final int DEFAULT_INITIAL_CONGESTION_WINDOW_PACKETS
      See Also:
  • Constructor Details

    • QuicConfig

      public QuicConfig()
    • QuicConfig

      public QuicConfig(QuicConfig other)
  • Method Details

    • copy

      protected QuicConfig copy()
      Specified by:
      copy in class TransportConfig
    • getInitialMaxData

      public long getInitialMaxData()
      Returns:
      the initialMaxData parameter value
      See Also:
    • setInitialMaxData

      public QuicConfig setInitialMaxData(long initialMaxData)

      Set the initialMaxData transport parameter.

      When set to a non-zero value, it will only allow at most initialMaxData bytes of incoming stream data to be buffered for the whole connection (that is, data that is not yet read by the application) and will allow more data to be received as the buffer is consumed by the application.

      Parameters:
      initialMaxData - the value to set
      Returns:
      this instance
    • getInitialMaxStreamDataBidiLocal

      public long getInitialMaxStreamDataBidiLocal()
      Returns:
      the initialMaxStreamDataBidiLocal parameter value
      See Also:
    • setInitialMaxStreamDataBidiLocal

      public QuicConfig setInitialMaxStreamDataBidiLocal(long initialMaxStreamDataBidiLocal)

      Set the initialMaxStreamDataBidiLocal transport parameter.

      When set to a non-zero value it will only allow at most initialMaxStreamDataBidiLocal bytes of incoming stream data to be buffered for each locally-initiated bidirectional stream (that is, data that is not yet read by the application) and will allow more data to be received as the buffer is consumed by the application.

      Parameters:
      initialMaxStreamDataBidiLocal - the value to set
      Returns:
      this instance
    • getInitialMaxStreamDataBidiRemote

      public long getInitialMaxStreamDataBidiRemote()
      Returns:
      the initialMaxStreamDataBidiRemote parameter value
      See Also:
    • setInitialMaxStreamDataBidiRemote

      public QuicConfig setInitialMaxStreamDataBidiRemote(long initialMaxStreamDataBidiRemote)

      Set the initialMaxStreamDataBidiRemote transport parameter.

      When set to a non-zero value it will only allow at most initialMaxStreamDataBidiRemote bytes of incoming stream data to be buffered for each remotely-initiated bidirectional stream (that is, data that is not yet read by the application) and will allow more data to be received as the buffer is consumed by the application.

      Parameters:
      initialMaxStreamDataBidiRemote - the value to set
      Returns:
      this instance
    • getInitialMaxStreamsBidi

      public long getInitialMaxStreamsBidi()
      Returns:
      the initialMaxStreamsBidi parameter value
      See Also:
    • setInitialMaxStreamsBidi

      public QuicConfig setInitialMaxStreamsBidi(long initialMaxStreamsBidi)

      Set the setInitialMaxStreamsBidi transport parameter.

      When set to a non-zero value it will only allow initialMaxStreamsBidi number of concurrent remotely-initiated bidirectional streams to be open at any given time and will increase the limit automatically as streams are completed.

      A bidirectional stream is considered completed when all incoming data has been read by the application (up to the fin offset) or the stream's read direction has been shutdown, and all outgoing data has been acked by the peer (up to the fin offset) or the stream's write direction has been shutdown.

      Parameters:
      initialMaxStreamsBidi - the value to set
      Returns:
      this instance
    • getInitialMaxStreamsUni

      public long getInitialMaxStreamsUni()
      Returns:
      the initialMaxStreamsUni parameter value
      See Also:
    • setInitialMaxStreamsUni

      public QuicConfig setInitialMaxStreamsUni(long initialMaxStreamsUni)

      Sets the initialMaxStreamsUni transport parameter.

      When set to a non-zero value it will only allow initialMaxStreamsUni number of concurrent remotely-initiated unidirectional streams to be open at any given time and will increase the limit automatically as streams are completed.

      A unidirectional stream is considered completed when all incoming data has been read by the application (up to the fin offset) or the stream's read direction has been shutdown.

      Parameters:
      initialMaxStreamsUni - the value to set
      Returns:
      this instance
    • getInitialMaxStreamDataUni

      public long getInitialMaxStreamDataUni()
      Returns:
      the initialMaxStreamDataUni parameter value
      See Also:
    • setInitialMaxStreamDataUni

      public QuicConfig setInitialMaxStreamDataUni(long initialMaxStreamDataUni)

      Sets the initialMaxStreamDataUni transport parameter.

      When set to a non-zero value it will only allow at most initialMaxStreamDataUni bytes of incoming stream data to be buffered for each unidirectional stream (that is, data that is not yet read by the application) and will allow more data to be received as the buffer is consumed by the application.

      Parameters:
      initialMaxStreamDataUni - the value to set
      Returns:
      this instance
    • getDisableActiveMigration

      public boolean getDisableActiveMigration()
      Returns:
      the activeMigration parameter value
      See Also:
    • setDisableActiveMigration

      public QuicConfig setDisableActiveMigration(boolean disableActiveMigration)

      Set whether to allow active migration.

      Parameters:
      disableActiveMigration - the value to set
      Returns:
      this instance
    • getMaxIdleTimeout

      public Duration getMaxIdleTimeout()
      Returns:
      the maxIdleTimeout parameter value
      See Also:
    • setMaxIdleTimeout

      public QuicConfig setMaxIdleTimeout(Duration maxIdleTimeout)

      Sets the maxIdleTimeout transport parameter.

      The default value is 40 seconds.

      Parameters:
      maxIdleTimeout - the value to set
      Returns:
      this instance
    • getDatagramConfig

      public QuicDatagramConfig getDatagramConfig()
      Returns:
      the datagram extension config
    • setDatagramConfig

      public QuicConfig setDatagramConfig(QuicDatagramConfig datagramConfig)
      Set the configuration of the datagram extension.
      Parameters:
      datagramConfig - the configuration of the
      Returns:
      this instance
    • getMaxAckDelay

      public Duration getMaxAckDelay()
      Returns:
      the maxAckDelay parameter value
      See Also:
    • setMaxAckDelay

      public QuicConfig setMaxAckDelay(Duration maxAckDelay)

      Sets the maxAckDelay transport parameter.

      The default value is 25 (milliseconds).

      Parameters:
      maxAckDelay - the value to set
      Returns:
      this instance
    • getAckDelayExponent

      public int getAckDelayExponent()
      Returns:
      the ackDelayExponent parameter value
      See Also:
    • setAckDelayExponent

      public QuicConfig setAckDelayExponent(int ackDelayExponent)

      Sets the ackDelayExponent transport parameter.

      The default value is 3.

      Parameters:
      ackDelayExponent - the value to set
      Returns:
      this instance
    • getCongestionControlAlgorithm

      public QuicCongestionControlAlgorithm getCongestionControlAlgorithm()
      Returns:
      the congestionControlAlgorithm parameter value
      See Also:
    • setCongestionControlAlgorithm

      public QuicConfig setCongestionControlAlgorithm(QuicCongestionControlAlgorithm congestionControlAlgorithm)

      Sets the congestion control algorithm used.

      The default value is QuicCongestionControlAlgorithm.CUBIC.

      Parameters:
      congestionControlAlgorithm - the congestion control algorithm to use
      Returns:
      this instance
    • getGrease

      public boolean getGrease()
      Returns:
      whether to send GREASE values
      See Also:
    • setGrease

      public QuicConfig setGrease(boolean grease)

      Configures whether to send GREASE values.

      The default value is true

      Parameters:
      grease - whether to send GREASE values.
      Returns:
      this instance
    • getHystart

      public boolean getHystart()
      Returns:
      whether to enable HyStart++
      See Also:
    • setHystart

      public QuicConfig setHystart(boolean hystart)

      Configures whether to enable HyStart++.

      The default value is true.

      Parameters:
      hystart - whether to enable HyStart++.
      Returns:
      this instance
    • getInitialCongestionWindowPackets

      public int getInitialCongestionWindowPackets()
      Returns:
      the initial congestion window size in terms of packet count
      See Also:
    • setInitialCongestionWindowPackets

      public QuicConfig setInitialCongestionWindowPackets(int initialCongestionWindowPackets)

      Sets initial congestion window size in terms of packet count.

      The default value is 10.

      Parameters:
      initialCongestionWindowPackets - the value to set
      Returns:
      this instance
    • forClient

      public static QuicConfig forClient()
      Returns:
      a sensitive default client configuration
    • forServer

      public static QuicConfig forServer()
      Returns:
      a sensitive default server configuration