Class ClientConfig.Builder
java.lang.Object
io.github.mahmoudimus.quic.connection.ClientConfig.Builder
- Enclosing class:
ClientConfig
Builds a
ClientConfig. Not thread-safe.-
Method Summary
Modifier and TypeMethodDescriptionactiveMigration(boolean activeMigration) Whether connections may migrate to a new local address (Connection.probePath(long, java.net.InetSocketAddress)), on by default.build()Builds the configuration.initialDcidLength(int length) The length of the random Destination Connection ID of the first Initial.preferredAddress(boolean preferredAddress) Whether to move to a server's preferred address (RFC 9000 section 9.6) once the handshake is confirmed, on by default: the client probes the address of its current path's family with the connection ID the server gave for it, and switches when the server answers.sessionCache(SessionCache cache) The cache of session tickets and NEW_TOKEN tokens: resumption, 0-RTT (withTlsConfig.Builder.earlyData(boolean)) and Retry-free reconnection.transport(TransportConfig transport) The transport settings.version(QuicVersion version) The QUIC version to use, version 1 by default.
-
Method Details
-
transport
The transport settings.- Parameters:
transport- the settings- Returns:
- this builder
-
version
The QUIC version to use, version 1 by default.- Parameters:
version- the version- Returns:
- this builder
-
initialDcidLength
The length of the random Destination Connection ID of the first Initial.- Parameters:
length- 8 to 20 bytes (RFC 9000 section 7.2); 20 by default- Returns:
- this builder
-
sessionCache
The cache of session tickets and NEW_TOKEN tokens: resumption, 0-RTT (withTlsConfig.Builder.earlyData(boolean)) and Retry-free reconnection.SessionCache.none()turns them off.- Parameters:
cache- the cache, or null for the caller's default- Returns:
- this builder
-
activeMigration
Whether connections may migrate to a new local address (Connection.probePath(long, java.net.InetSocketAddress)), on by default. Off, the client sendsdisable_active_migrationand refuses to migrate. A server that sentdisable_active_migrationis never migrated away from either way, except to its preferred address.- Parameters:
activeMigration- whether to allow active migration- Returns:
- this builder
-
preferredAddress
Whether to move to a server's preferred address (RFC 9000 section 9.6) once the handshake is confirmed, on by default: the client probes the address of its current path's family with the connection ID the server gave for it, and switches when the server answers.- Parameters:
preferredAddress- whether to follow a preferred address- Returns:
- this builder
-
build
Builds the configuration.- Returns:
- the configuration
-