QuicOptions.Builder
public
static
final
class
QuicOptions.Builder
extends Object
java.lang.Object | |
↳ | android.net.http.QuicOptions.Builder |
Builder for QuicOptions
.
Summary
Public constructors | |
---|---|
Builder()
|
Public methods | |
---|---|
QuicOptions.Builder
|
addAllowedQuicHost(String quicHost)
Adds a host to the QUIC allowlist. |
QuicOptions
|
build()
Creates and returns the final |
QuicOptions.Builder
|
setHandshakeUserAgent(String handshakeUserAgent)
Sets the user agent to be used outside of HTTP requests (for example for QUIC handshakes). |
QuicOptions.Builder
|
setIdleConnectionTimeout(Duration idleConnectionTimeout)
Sets the maximum idle time for a connection. |
QuicOptions.Builder
|
setInMemoryServerConfigsCacheSize(int inMemoryServerConfigsCacheSize)
Sets how many server configurations (metadata like list of alt svc, whether QUIC is supported, etc.) should be held in memory. |
Inherited methods | |
---|---|
Public constructors
Public methods
addAllowedQuicHost
public QuicOptions.Builder addAllowedQuicHost (String quicHost)
Adds a host to the QUIC allowlist.
If no hosts are specified, the per-host allowlist functionality is disabled. Otherwise, the HTTP stack will only use QUIC when talking to hosts on the allowlist.
Parameters | |
---|---|
quicHost |
String : This value cannot be null . |
Returns | |
---|---|
QuicOptions.Builder |
the builder for chaining
This value cannot be null . |
build
public QuicOptions build ()
Creates and returns the final QuicOptions
instance, based on the values
in this builder.
Returns | |
---|---|
QuicOptions |
This value cannot be null . |
setHandshakeUserAgent
public QuicOptions.Builder setHandshakeUserAgent (String handshakeUserAgent)
Sets the user agent to be used outside of HTTP requests (for example for QUIC handshakes).
To set the default user agent for HTTP requests, use
HttpEngine.Builder.setUserAgent(String)
instead.
Parameters | |
---|---|
handshakeUserAgent |
String : This value cannot be null . |
Returns | |
---|---|
QuicOptions.Builder |
the builder for chaining
This value cannot be null . |
setIdleConnectionTimeout
public QuicOptions.Builder setIdleConnectionTimeout (Duration idleConnectionTimeout)
Sets the maximum idle time for a connection. The actual value for the idle timeout is the minimum of this value and the server's and is negotiated during the handshake. Thus, it only applies after the handshake has completed. If no activity is detected on the connection for the set duration, the connection is closed.
See RFC 9114, section 5.1 for more details.
Parameters | |
---|---|
idleConnectionTimeout |
Duration : This value cannot be null . |
Returns | |
---|---|
QuicOptions.Builder |
the builder for chaining
This value cannot be null . |
setInMemoryServerConfigsCacheSize
public QuicOptions.Builder setInMemoryServerConfigsCacheSize (int inMemoryServerConfigsCacheSize)
Sets how many server configurations (metadata like list of alt svc, whether QUIC is supported, etc.) should be held in memory.
If the storage path is set (HttpEngine.Builder.setStoragePath(String)
,
the HTTP stack will also persist the server configurations on disk.
Parameters | |
---|---|
inMemoryServerConfigsCacheSize |
int |
Returns | |
---|---|
QuicOptions.Builder |
the builder for chaining
This value cannot be null . |