APIdia Launch Partner
Top Description Methods
jdk.internal.net.http.quic

public Interface QuicInstance

Known Direct Implementers
jdk.internal.net.http.quic.QuicClient
Imports
java.io.IOException, java.net.SocketAddress, java.nio.ByteBuffer, java.util.HexFormat, .List, java.util.concurrent.Executor, javax.net.ssl.SSLParameters, jdk.internal.net.http.common.Utils, jdk.internal.net.http.quic.packets.QuicPacket, jdk.internal.net.quic.QuicTLSContext, .QuicVersion

A QuicInstance represents a common abstraction which is either a QuicClient or a QuicServer, or possibly both. It defines the subset of public methods that a QuicEndpoint and a QuicSelector need to operate with a quic client, or a quic server;

Method Summary

Modifier and TypeMethod and Description
public default String

Returns:

a string describing the given application error code
appErrorToString
(long
an application error code
errorCode
)

Returns a string describing the given application error code.

public Executor

Returns:

the executor used by this QuicClient.
executor
()

The executor used by this quic instance when a task needs to be offloaded to a separate thread.

public List<QuicVersion>

Returns:

the versions that are available for use on this instance
getAvailableVersions
()

Returns the versions that are available for use on this instance.

public QuicEndpoint

Returns:

an endpoint to associate with a connection
getEndpoint
()

Returns an endpoint to associate with a connection.

public QuicTLSContext

Returns:

the QuicTLSContext used by this quic instance.
getQuicTLSContext
()

Get the QuicTLSContext used by this quic instance.

public default int

Returns:

the configured UDP receive buffer size this instance should use
getReceiveBufferSize
()

Returns the configured UDP receive buffer size this instance should use.

public default int

Returns:

the configured UDP send buffer size this instance should use
getSendBufferSize
()

Returns the configured UDP send buffer size this instance should use.

public default SSLParameters

Returns:

The SSLParameters for this quic instance or null.
getSSLParameters
()

The SSLParameters for this Quic instance.

public QuicTransportParameters
public String

Returns:

A string uniquely identifying this instance.
instanceId
()

Instance ID used for debugging traces.

public boolean

Returns:

true if the passed version is available for use on this instance, false otherwise
isVersionAvailable
(QuicVersion quicVersion)

Returns true if the passed version is available for use on this instance, false otherwise.

public default String
name()

public void
unmatchedQuicPacket(SocketAddress
the source address of the datagram
source
,
QuicPacket.HeadersType
the packet type
type
,
ByteBuffer
A buffer positioned at the start of the quic packet
buffer
)

This method is called when a quic packet that couldn't be attributed to a registered connection is received.

Method Detail

appErrorToStringback to summary
public default String appErrorToString(long errorCode)

Returns a string describing the given application error code.

Implementation Specification

By default, this method returns a generic string containing the hexadecimal value of the given errorCode. Subclasses built for supporting a given application protocol, such as HTTP/3, may override this method to return more specific names, such as for instance, "H3_REQUEST_CANCELLED" for 0x010c.

API Note

This method is typically used for logging and/or debugging purposes, to generate a more user-friendly log message.

Parameters
errorCode:long

an application error code

Returns:String

a string describing the given application error code

executorback to summary
public Executor executor()

The executor used by this quic instance when a task needs to be offloaded to a separate thread.

Implementation Note

This is the HttpClientImpl internal executor.

Returns:Executor

the executor used by this QuicClient.

getAvailableVersionsback to summary
public List<QuicVersion> getAvailableVersions()

Returns the versions that are available for use on this instance.

Returns:List<QuicVersion>

the versions that are available for use on this instance

getEndpointback to summary
public QuicEndpoint getEndpoint() throws IOException

Returns an endpoint to associate with a connection.

Returns:QuicEndpoint

an endpoint to associate with a connection

getQuicTLSContextback to summary
public QuicTLSContext getQuicTLSContext()

Get the QuicTLSContext used by this quic instance.

Returns:QuicTLSContext

the QuicTLSContext used by this quic instance.

getReceiveBufferSizeback to summary
public default int getReceiveBufferSize()

Returns the configured UDP receive buffer size this instance should use.

Returns:int

the configured UDP receive buffer size this instance should use

getSendBufferSizeback to summary
public default int getSendBufferSize()

Returns the configured UDP send buffer size this instance should use.

Returns:int

the configured UDP send buffer size this instance should use

getSSLParametersback to summary
public default SSLParameters getSSLParameters()

The SSLParameters for this Quic instance. May be null if no parameters have been specified.

Implementation Specification

The default implementation of this method returns null.

Returns:SSLParameters

The SSLParameters for this quic instance or null.

getTransportParametersback to summary
public QuicTransportParameters getTransportParameters()
instanceIdback to summary
public String instanceId()

Instance ID used for debugging traces.

Returns:String

A string uniquely identifying this instance.

isVersionAvailableback to summary
public boolean isVersionAvailable(QuicVersion quicVersion)

Returns true if the passed version is available for use on this instance, false otherwise.

Returns:boolean

true if the passed version is available for use on this instance, false otherwise

nameback to summary
public default String name()
unmatchedQuicPacketback to summary
public void unmatchedQuicPacket(SocketAddress source, QuicPacket.HeadersType type, ByteBuffer buffer)

This method is called when a quic packet that couldn't be attributed to a registered connection is received.

Parameters
source:SocketAddress

the source address of the datagram

type:QuicPacket.HeadersType

the packet type

buffer:ByteBuffer

A buffer positioned at the start of the quic packet