HttpQuicConnection models an HTTP connection over
QUIC.
The particulars of the HTTP/3 protocol are handled by the
Http3Connection class.
| Modifier and Type | Class and Description |
|---|---|
| private static interface | HttpQuicConnection.
A functional interface used to update the Alternate Service Registry after a direct connection attempt. |
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| private volatile boolean | |
| pack-priv final Logger | |
| pack-priv final QuicConnection | |
| pack-priv final ConnectionTerminator | |
| private final AltServicesRegistry. |
| Access | Constructor and Description |
|---|---|
| pack-priv | HttpQuicConnection(Origin originServer, InetSocketAddress address, HttpClientImpl client, QuicConnection quicConnection, AltServicesRegistry.
|
| Modifier and Type | Method and Description |
|---|---|
| pack-priv abstract ConnectionPool. | |
| pack-priv abstract NetworkChannel | |
| pack-priv final void | close(final long
the connection close code connCloseCode, final String the message to be included in the logs as
the cause of the connection termination. can be null. logMsg, final Throwable the underlying cause of the connection termination. can be null,
in which case just the closeCause)error will be recorded as the
cause of the connection termination.Closes the underlying transport connection with
the given |
| pack-priv abstract void | close(final Throwable t)
Implements abstract jdk. Closes this connection due to the given cause. |
| public abstract CompletableFuture | connectAsync(Exchange<?> exchange)
Implements abstract jdk. Initiates the connect phase. |
| pack-priv boolean | connected()
Implements abstract jdk. Tells whether, or not, this connection is connected to its destination. |
| public abstract void | connectionEstablished(Http3Connection
the HTTP/3 connection, if successful, or null, otherwise connection, Throwable the exception encountered, if unsuccessful throwable)Called when the HTTP/3 connection is established, either successfully or unsuccessfully |
| public CompletableFuture | finishConnect()
Implements abstract jdk. Finishes the connection phase. |
| pack-priv final FlowTube | Returns: nothing: this method always throwIllegalStateExceptionImplements abstract jdk. Returns the underlying connection flow, if applicable. |
| public static HttpQuicConnection | Returns: A new HttpQuicConnection ornullthe HTTP/3 peer endpoint address, if direct connection addr, final InetSocketAddress the proxy address, if a proxy is used, in which case this
method will return proxy, final HttpRequestImpl null as proxying is not supported
with HTTP/3the request for which the connection is being created request, final Exchange<?> the exchange for which the connection is being created exchange, final HttpClientImpl the HttpClientImpl instance client)This method create and return a new unconnected HttpQuicConnection,
wrapping a |
| public List | getSNIServerNames()
Overrides jdk. Returns an unmodifiable list of |
| pack-priv Optional | Returns: The source alt-service if presentA HTTP QUIC connection could be created due to an alt-service that was advertised from some origin. |
| pack-priv boolean | Returns: true if the underlying Quic connection
has been terminated.Overrides jdk. Unlike HTTP/1.1 and HTTP/2, an HTTP/3 connection is not built on a single connection flow, since multiplexing is provided by the lower layer. |
| pack-priv final boolean | isProxied()
Implements abstract jdk. Tells whether, or not, this connection is proxied. |
| pack-priv final boolean | isSecure()
Implements abstract jdk. Tells whether, or not, this connection is secure ( over SSL ) |
| pack-priv boolean | |
| private static void | |
| pack-priv final InetSocketAddress | proxy()
Implements abstract jdk. Returns the address of the proxy used by this connection. |
| pack-priv final HttpConnection. | publisher()
Implements abstract jdk. This method throws an |
| pack-priv QuicConnection | |
| pack-priv final String | |
| pack-priv static void | registerUnadvertised(final HttpClientImpl client, final URI requestURI, final InetSocketAddress destAddr, final Http3Connection connection, final Throwable t)
|
| public String | toString()
Overrides jdk. Returns a string representation of the object. |
| connected | back to summary |
|---|---|
| private volatile boolean connected | |
| debug | back to summary |
|---|---|
| pack-priv final Logger debug | |
| quicConnection | back to summary |
|---|---|
| pack-priv final QuicConnection quicConnection | |
| quicConnTerminator | back to summary |
|---|---|
| pack-priv final ConnectionTerminator quicConnTerminator | |
| sourceAltService | back to summary |
|---|---|
| private final AltServicesRegistry. | |
| HttpQuicConnection | back to summary |
|---|---|
| pack-priv HttpQuicConnection(Origin originServer, InetSocketAddress address, HttpClientImpl client, QuicConnection quicConnection, AltServicesRegistry. | |
| cacheKey | back to summary |
|---|---|
| pack-priv abstract ConnectionPool. Implements abstract jdk. | |
| channel | back to summary |
|---|---|
| pack-priv abstract NetworkChannel channel() Implements abstract jdk. | |
| close | back to summary |
|---|---|
| pack-priv final void close(final long connCloseCode, final String logMsg, final Throwable closeCause) Closes the underlying transport connection with
the given
| |
| close | back to summary |
|---|---|
| pack-priv abstract void close(final Throwable t) Implements abstract jdk. Doc from jdk. Closes this connection due to the given cause. | |
| connectAsync | back to summary |
|---|---|
| public abstract CompletableFuture Implements abstract jdk. Initiates the connect phase. Returns a CompletableFuture that completes when the underlying TCP connection has been established or an error occurs. | |
| connected | back to summary |
|---|---|
| pack-priv boolean connected() Implements abstract jdk. Tells whether, or not, this connection is connected to its destination. | |
| connectionEstablished | back to summary |
|---|---|
| public abstract void connectionEstablished(Http3Connection connection, Throwable throwable) Called when the HTTP/3 connection is established, either successfully or unsuccessfully
| |
| finishConnect | back to summary |
|---|---|
| public CompletableFuture Implements abstract jdk. Finishes the connection phase. Returns a CompletableFuture that completes when any additional, type specific, setup has been done. Must be called after connectAsync. | |
| getConnectionFlow | back to summary |
|---|---|
| pack-priv final FlowTube getConnectionFlow() Implements abstract jdk. Doc from jdk. Returns the underlying connection flow, if applicable. Implementation Specification Unlike HTTP/1.1 and HTTP/2, an HTTP/3 connection is not
built on a single connection flow, since multiplexing is
provided by the lower layer. Therefore, the higher HTTP
layer should never call
| |
| getHttpQuicConnection | back to summary |
|---|---|
| public static HttpQuicConnection getHttpQuicConnection(final InetSocketAddress addr, final InetSocketAddress proxy, final HttpRequestImpl request, final Exchange<?> exchange, final HttpClientImpl client) This method create and return a new unconnected HttpQuicConnection,
wrapping a
| |
| getSNIServerNames | back to summary |
|---|---|
| public List Overrides jdk. Doc from jdk. Returns an unmodifiable list of
| |
| getSourceAltService | back to summary |
|---|---|
| pack-priv Optional A HTTP QUIC connection could be created due to an alt-service that was advertised from some origin. This method returns that source alt-service if there was one.
| |
| isFlowFinished | back to summary |
|---|---|
| pack-priv boolean isFlowFinished() Overrides jdk. Unlike HTTP/1.1 and HTTP/2, an HTTP/3 connection is not
built on a single connection flow, since multiplexing is
provided by the lower layer. This method instead will
return
| |
| isProxied | back to summary |
|---|---|
| pack-priv final boolean isProxied() Implements abstract jdk. Tells whether, or not, this connection is proxied. Returns true for tunnel connections, or clear connection to any host through proxy. | |
| isSecure | back to summary |
|---|---|
| pack-priv final boolean isSecure() Implements abstract jdk. Tells whether, or not, this connection is secure ( over SSL ) | |
| isTunnel | back to summary |
|---|---|
| pack-priv boolean isTunnel() | |
| logAltSvcFor | back to summary |
|---|---|
| private static void logAltSvcFor(Logger debug, URI uri, AltServicesRegistry. | |
| proxy | back to summary |
|---|---|
| pack-priv final InetSocketAddress proxy() Implements abstract jdk. Returns the address of the proxy used by this connection.
Returns the proxy address for tunnel connections, or
clear connection to any host through proxy.
Returns | |
| publisher | back to summary |
|---|---|
| pack-priv final HttpConnection. Implements abstract jdk. This method throws an
| |
| quicConnection | back to summary |
|---|---|
| pack-priv QuicConnection quicConnection() | |
| quicDbgString | back to summary |
|---|---|
| pack-priv final String quicDbgString() | |
| registerUnadvertised | back to summary |
|---|---|
| pack-priv static void registerUnadvertised(final HttpClientImpl client, final URI requestURI, final InetSocketAddress destAddr, final Http3Connection connection, final Throwable t) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides jdk. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
| Modifier and Type | Method and Description |
|---|---|
| public static void | |
| public void | onConnectionEstablished(Http3Connection
the connection or null conn, Throwable the exception or null throwable)This method may update the HttpClient registry, or record the unsuccessful direct connection attempt. |
| noUpdate | back to summary |
|---|---|
| public static void noUpdate(Http3Connection conn, Throwable throwable) Does nothing
| |
| onConnectionEstablished | back to summary |
|---|---|
| public void onConnectionEstablished(Http3Connection conn, Throwable throwable) This method may update the HttpClient registry, or record the unsuccessful direct connection attempt.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final HttpQuicConnection. | |
| private final Optional |
| Access | Constructor and Description |
|---|---|
| pack-priv | H3QuicConnectionImpl(Origin originServer, InetSocketAddress address, HttpClientImpl client, QuicConnection quic, HttpQuicConnection.
|
| Modifier and Type | Method and Description |
|---|---|
| pack-priv ConnectionPool. | |
| pack-priv NetworkChannel | |
| public final void | close()
Implements abstract jdk. Implements java. Closes this connection. |
| pack-priv void | close(final Throwable cause)
Implements abstract jdk. Closes this connection due to the given cause. |
| public CompletableFuture | connectAsync(Exchange<?> exchange)
Implements abstract jdk. Initiates the connect phase. |
| public void | connectionEstablished(Http3Connection connection, Throwable throwable)
Implements abstract jdk. Called when the HTTP/3 connection is established, either successfully or unsuccessfully |
| private <U> CompletableFuture |
| connFinishedAction | back to summary |
|---|---|
| private final HttpQuicConnection. | |
| directTimeout | back to summary |
|---|---|
| private final Optional<Duration> directTimeout | |
| H3QuicConnectionImpl | back to summary |
|---|---|
| pack-priv H3QuicConnectionImpl(Origin originServer, InetSocketAddress address, HttpClientImpl client, QuicConnection quic, HttpQuicConnection. | |
| cacheKey | back to summary |
|---|---|
| pack-priv ConnectionPool. Implements abstract jdk.
| |
| channel | back to summary |
|---|---|
| pack-priv NetworkChannel channel() Implements abstract jdk.
| |
| close | back to summary |
|---|---|
| public final void close() Implements abstract jdk. Implements java. Doc from jdk. Closes this connection.
| |
| close | back to summary |
|---|---|
| pack-priv void close(final Throwable cause) Implements abstract jdk. Doc from jdk. Closes this connection due to the given cause.
| |
| connectAsync | back to summary |
|---|---|
| public CompletableFuture Implements abstract jdk. Doc from jdk. Initiates the connect phase. Returns a CompletableFuture that completes when the underlying TCP connection has been established or an error occurs.
| |
| connectionEstablished | back to summary |
|---|---|
| public void connectionEstablished(Http3Connection connection, Throwable throwable) Implements abstract jdk. Doc from jdk. Called when the HTTP/3 connection is established, either successfully or unsuccessfully
| |
| handleTimeout | back to summary |
|---|---|
| private <U> CompletableFuture | |