Class TransportConfig
java.lang.Object
io.github.mahmoudimus.quic.connection.TransportConfig
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds aTransportConfig.static enumThe congestion controllers this module provides. -
Method Summary
Modifier and TypeMethodDescriptionstatic TransportConfig.Builderbuilder()A builder starting from the defaults.intThe largest DATAGRAM payload buffered for the application, or 0 when DATAGRAM frames are refused.static TransportConfigdefaults()The default settings.keyLog()The receiver of TLS secrets for packet analyzers, if any.The idle timeout this endpoint offers; the connection uses the smaller of both sides'.booleanWhether MTU discovery is on.qlog()The receiver of qlog-style events, if any.longThe connection receive window.longThe most outgoing stream data buffered, unacknowledged, per connection.longThe per-stream receive window.A builder starting from this configuration.
-
Method Details
-
defaults
The default settings.- Returns:
- the shared default configuration
-
builder
A builder starting from the defaults.- Returns:
- a new builder
-
toBuilder
A builder starting from this configuration.- Returns:
- a new builder with these settings
-
maxIdleTimeout
The idle timeout this endpoint offers; the connection uses the smaller of both sides'.- Returns:
- the timeout, or
Duration.ZEROfor 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
The receiver of TLS secrets for packet analyzers, if any.- Returns:
- the key log, or null
-
qlog
The receiver of qlog-style events, if any.- Returns:
- the sink, or null
-