Class TransportConfig

java.lang.Object
io.github.mahmoudimus.quic.connection.TransportConfig

public final class TransportConfig extends Object
The transport settings of a connection, the same for both sides: flow-control windows, stream limits, timeouts, loss detection, congestion control, MTU discovery, DATAGRAM support and the debugging aids. Immutable and shareable; start from defaults() or builder().

The defaults follow quinn's: 100 concurrent streams of each directionality, a 30 second idle timeout, a 1.25 MB stream window, CUBIC, MTU discovery on. The connection receive window is bounded (10 MB by default) rather than unlimited, so memory a peer can make a connection hold is bounded too.

  • Method Details

    • defaults

      public static TransportConfig defaults()
      The default settings.
      Returns:
      the shared default configuration
    • builder

      public static TransportConfig.Builder builder()
      A builder starting from the defaults.
      Returns:
      a new builder
    • toBuilder

      public TransportConfig.Builder toBuilder()
      A builder starting from this configuration.
      Returns:
      a new builder with these settings
    • maxIdleTimeout

      public Duration maxIdleTimeout()
      The idle timeout this endpoint offers; the connection uses the smaller of both sides'.
      Returns:
      the timeout, or Duration.ZERO for none
    • streamReceiveWindow

      public long streamReceiveWindow()
      The per-stream receive window.
      Returns:
      bytes
    • receiveWindow

      public long receiveWindow()
      The connection receive window.
      Returns:
      bytes
    • sendWindow

      public long sendWindow()
      The most outgoing stream data buffered, unacknowledged, per connection.
      Returns:
      bytes
    • mtuDiscoveryEnabled

      public boolean mtuDiscoveryEnabled()
      Whether MTU discovery is on.
      Returns:
      true if it is
    • datagramReceiveBufferSize

      public int datagramReceiveBufferSize()
      The largest DATAGRAM payload buffered for the application, or 0 when DATAGRAM frames are refused.
      Returns:
      bytes
    • keyLog

      public KeyLog keyLog()
      The receiver of TLS secrets for packet analyzers, if any.
      Returns:
      the key log, or null
    • qlog

      public QlogSink qlog()
      The receiver of qlog-style events, if any.
      Returns:
      the sink, or null