| Modifier and Type | Class and Description |
|---|---|
| pack-priv static interface | |
| pack-priv class | HttpConnection.
A publisher that makes it possible to publish (write) ordered (normal priority) and unordered (high priority) buffers downstream. |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final InetSocketAddress | address
The address this connection is connected to. |
| private final HttpClientImpl | |
| public static final Comparator | |
| pack-priv String | |
| pack-priv final Logger | |
| pack-priv static final Logger | |
| private final long | id
A unique identifier that provides a total order among instances. |
| private final String | label
A label to identify the connection. |
| private static final AtomicLong | |
| private final Origin | |
| private final HttpConnection. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv final InetSocketAddress | |
| pack-priv final void | |
| pack-priv abstract ConnectionPool. | |
| pack-priv abstract NetworkChannel | |
| pack-priv boolean | Returns: true if the channel appears to be still open.Forces a call to the native implementation of the connection's channel to verify that this channel is still open. |
| pack-priv final HttpClientImpl | |
| public abstract void | |
| pack-priv abstract void | |
| pack-priv void | |
| public abstract CompletableFuture | |
| pack-priv abstract boolean | |
| pack-priv BiPredicate | |
| pack-priv final String | |
| public abstract CompletableFuture | |
| public static HttpConnection | getConnection(InetSocketAddress addr, HttpClientImpl client, Exchange<?> exchange, HttpRequestImpl request, HttpClient.
Factory for retrieving HttpConnections. |
| pack-priv abstract FlowTube | Returns: the underlying connection flow, if applicableReturns the underlying connection flow, if applicable. |
| pack-priv final Origin | Returns: theOrigin server against which this connection communicates.
Returns null if the connection is a plain connection to a proxyReturns the |
| private static HttpConnection | getPlainConnection(InetSocketAddress addr, InetSocketAddress proxy, HttpRequestImpl request, HttpClientImpl client)
|
| public List | Returns: the SNI server namesReturns an unmodifiable list of |
| private static HttpConnection | getSSLConnection(InetSocketAddress addr, InetSocketAddress proxy, String[] alpn, HttpRequestImpl request, HttpClientImpl client)
|
| pack-priv BiPredicate | headerFilter(HttpRequestImpl request)
This method is used to build a filter that will accept or veto (header-name, value) tuple for transmission on the wire. |
| private long | |
| pack-priv boolean | |
| pack-priv boolean | |
| pack-priv abstract boolean | |
| pack-priv abstract boolean | |
| pack-priv boolean | |
| public final String | Returns: a label identifying the connection to facilitateHttpResponse::connectionLabelReturns a label identifying the connection to facilitate
|
| pack-priv long | |
| private static String | |
| pack-priv abstract InetSocketAddress | |
| private static Utils. | |
| pack-priv abstract HttpConnection. | |
| public String |
| address | back to summary |
|---|---|
| pack-priv final InetSocketAddress address The address this connection is connected to. Could be a server or a proxy. | |
| client | back to summary |
|---|---|
| private final HttpClientImpl client | |
| COMPARE_BY_ID | back to summary |
|---|---|
| public static final Comparator<HttpConnection> COMPARE_BY_ID | |
| dbgTag | back to summary |
|---|---|
| pack-priv String dbgTag | |
| debug | back to summary |
|---|---|
| pack-priv final Logger debug | |
| DEBUG_LOGGER | back to summary |
|---|---|
| pack-priv static final Logger DEBUG_LOGGER | |
| id | back to summary |
|---|---|
| private final long id A unique identifier that provides a total order among instances. | |
| label | back to summary |
|---|---|
| private final String label A label to identify the connection.
This label helps with associating multiple components participating in a
connection. For instance, an | |
| LABEL_COUNTER | back to summary |
|---|---|
| private static final AtomicLong LABEL_COUNTER | |
| originServer | back to summary |
|---|---|
| private final Origin originServer | |
| trailingOperations | back to summary |
|---|---|
| private final HttpConnection. | |
| HttpConnection | back to summary |
|---|---|
| pack-priv HttpConnection(Origin originServer, InetSocketAddress address, HttpClientImpl client, String label) | |
| address | back to summary |
|---|---|
| pack-priv final InetSocketAddress address() | |
| addTrailingOperation | back to summary |
|---|---|
| pack-priv final void addTrailingOperation(CompletionStage<?> cf) | |
| cacheKey | back to summary |
|---|---|
| pack-priv abstract ConnectionPool. | |
| channel | back to summary |
|---|---|
| pack-priv abstract NetworkChannel channel() | |
| checkOpen | back to summary |
|---|---|
| pack-priv boolean checkOpen() Forces a call to the native implementation of the connection's channel to verify that this channel is still open. This method should only be called just after an HTTP/1.1 connection is retrieved from the HTTP/1.1 connection pool. It is used to trigger an early detection of the channel state, before handling the connection over to the HTTP stack. It helps minimizing race conditions where the selector manager thread hasn't woken up - or hasn't raised the event, before the connection was retrieved from the pool. It helps reduce the occurrence of "HTTP/1.1 parser received no bytes" exception, when the server closes the connection while it's being taken out of the pool. This method attempts to read one byte from the underlying channel. Because the connection was in the pool - there should be nothing to read.
If
| |
| client | back to summary |
|---|---|
| pack-priv final HttpClientImpl client() | |
| close | back to summary |
|---|---|
| public abstract void close() Redeclares java. Closes this connection.
| |
| close | back to summary |
|---|---|
| pack-priv abstract void close(Throwable cause) Closes this connection due to the given cause.
| |
| closeOrReturnToCache | back to summary |
|---|---|
| pack-priv void closeOrReturnToCache(HttpHeaders hdrs) | |
| connectAsync | back to summary |
|---|---|
| public abstract CompletableFuture 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 abstract boolean connected() Tells whether, or not, this connection is connected to its destination. | |
| contextRestricted | back to summary |
|---|---|
| pack-priv BiPredicate | |
| dbgString | back to summary |
|---|---|
| pack-priv final String dbgString() | |
| finishConnect | back to summary |
|---|---|
| public abstract CompletableFuture Finishes the connection phase. Returns a CompletableFuture that completes when any additional, type specific, setup has been done. Must be called after connectAsync. | |
| getConnection | back to summary |
|---|---|
| public static HttpConnection getConnection(InetSocketAddress addr, HttpClientImpl client, Exchange<?> exchange, HttpRequestImpl request, HttpClient. Factory for retrieving HttpConnections. A connection can be retrieved
from the connection pool, or a new one created if none available.
The given | |
| getConnectionFlow | back to summary |
|---|---|
| pack-priv abstract FlowTube getConnectionFlow() Returns the underlying connection flow, if applicable. API Note TCP based protocols like HTTP/1.1 and HTTP/2 are built on top of a bidirectional connection flow. On the other hand, Quic based protocol like HTTP/3 are multiplexed at the Quic level, and therefore do not have a connection flow.
| |
| getOriginServer | back to summary |
|---|---|
| pack-priv final Origin getOriginServer() Returns the | |
| getPlainConnection | back to summary |
|---|---|
| private static HttpConnection getPlainConnection(InetSocketAddress addr, InetSocketAddress proxy, HttpRequestImpl request, HttpClientImpl client) | |
| getSNIServerNames | back to summary |
|---|---|
| public List Returns an unmodifiable list of
| |
| getSSLConnection | back to summary |
|---|---|
| private static HttpConnection getSSLConnection(InetSocketAddress addr, InetSocketAddress proxy, String[] alpn, HttpRequestImpl request, HttpClientImpl client) | |
| headerFilter | back to summary |
|---|---|
| pack-priv BiPredicate This method is used to build a filter that will accept or veto (header-name, value) tuple for transmission on the wire. The filter is applied to the headers when sending the headers to the remote party. Which tuple is accepted/vetoed depends on:
- whether the connection is a tunnel connection
[talking to a server through a proxy tunnel]
- whether the method is CONNECT
[establishing a CONNECT tunnel through a proxy]
- whether the request is using a proxy
(and the connection is not a tunnel)
[talking to a server through a proxy]
- whether the request is a direct connection to
a server (no tunnel, no proxy).
| |
| id | back to summary |
|---|---|
| private long id() | |
| isFlowFinished | back to summary |
|---|---|
| pack-priv boolean isFlowFinished() {@return | |
| isOpen | back to summary |
|---|---|
| pack-priv boolean isOpen() Tells whether, or not, this connection is open. | |
| isProxied | back to summary |
|---|---|
| pack-priv abstract boolean isProxied() 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 abstract boolean isSecure() Tells whether, or not, this connection is secure ( over SSL ) | |
| isTunnel | back to summary |
|---|---|
| pack-priv boolean isTunnel() | |
| label | back to summary |
|---|---|
| public final String label() Returns a label identifying the connection to facilitate
| |
| newConnectionId | back to summary |
|---|---|
| pack-priv long newConnectionId(HttpClientImpl client) | |
| nextLabel | back to summary |
|---|---|
| private static String nextLabel(String prefix) | |
| proxy | back to summary |
|---|---|
| pack-priv abstract InetSocketAddress proxy() 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 | |
| proxyTunnelHeaders | back to summary |
|---|---|
| private static Utils. | |
| publisher | back to summary |
|---|---|
| pack-priv abstract HttpConnection. Returns the HTTP publisher associated with this connection. May be null if invoked before connecting. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. 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 void | |
| public void | |
| public void |
| enqueue | back to summary |
|---|---|
| public void enqueue(List<ByteBuffer> buffers) throws IOException | |
| enqueueUnordered | back to summary |
|---|---|
| public void enqueueUnordered(List<ByteBuffer> buffers) throws IOException | |
| signalEnqueued | back to summary |
|---|---|
| public void signalEnqueued() throws IOException | |
| Modifier and Type | Class and Description |
|---|---|
| pack-priv class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final ConcurrentLinkedDeque | |
| pack-priv final ConcurrentLinkedDeque | |
| pack-priv final Object | |
| pack-priv volatile Flow. | |
| pack-priv volatile HttpConnection. | |
| pack-priv final SequentialScheduler |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | enqueue(List<ByteBuffer> buffers)
Implements jdk.
|
| public void | |
| pack-priv void | |
| pack-priv void | |
| public void | |
| public void | subscribe(Flow.
Implements java. Adds the given Subscriber if possible. |
| priority | back to summary |
|---|---|
| pack-priv final ConcurrentLinkedDeque<List<ByteBuffer>> priority | |
| queue | back to summary |
|---|---|
| pack-priv final ConcurrentLinkedDeque<List<ByteBuffer>> queue | |
| reading | back to summary |
|---|---|
| pack-priv final Object reading | |
| subscriber | back to summary |
|---|---|
| pack-priv volatile Flow. | |
| subscription | back to summary |
|---|---|
| pack-priv volatile HttpConnection. | |
| writeScheduler | back to summary |
|---|---|
| pack-priv final SequentialScheduler writeScheduler | |
| PlainHttpPublisher | back to summary |
|---|---|
| pack-priv PlainHttpPublisher() | |
| PlainHttpPublisher | back to summary |
|---|---|
| pack-priv PlainHttpPublisher(Object readingLock) | |
| enqueue | back to summary |
|---|---|
| public void enqueue(List<ByteBuffer> buffers) throws IOException Implements jdk.
| |
| enqueueUnordered | back to summary |
|---|---|
| public void enqueueUnordered(List<ByteBuffer> buffers) throws IOException Implements jdk.
| |
| flushTask | back to summary |
|---|---|
| pack-priv void flushTask(SequentialScheduler. | |
| signal | back to summary |
|---|---|
| pack-priv void signal() | |
| signalEnqueued | back to summary |
|---|---|
| public void signalEnqueued() throws IOException Implements jdk.
| |
| subscribe | back to summary |
|---|---|
| public void subscribe(Flow. Implements java. Doc from java. Adds the given Subscriber if possible. If already
subscribed, or the attempt to subscribe fails due to policy
violations or errors, the Subscriber's
| |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | cancel()
Implements java. Causes the Subscriber to (eventually) stop receiving messages. |
| pack-priv void | |
| private boolean | |
| private List | |
| public void | request(long n)
Implements java. Adds the given number |
| demand | back to summary |
|---|---|
| pack-priv final Demand demand | |
| HttpWriteSubscription | back to summary |
|---|---|
| pack-priv HttpWriteSubscription() | |
| cancel | back to summary |
|---|---|
| public void cancel() Implements java. Doc from java. Causes the Subscriber to (eventually) stop receiving
messages. Implementation is best-effort -- additional
messages may be received after invoking this method.
A cancelled subscription need not ever receive an
| |
| flush | back to summary |
|---|---|
| pack-priv void flush() | |
| isEmpty | back to summary |
|---|---|
| private boolean isEmpty() | |
| poll | back to summary |
|---|---|
| private List | |
| request | back to summary |
|---|---|
| public void request(long n) Implements java. Doc from java. Adds the given number
| |
| Modifier and Type | Field and Description |
|---|---|
| private final Map |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| pack-priv boolean |
| operations | back to summary |
|---|---|
| private final Map<CompletionStage<?>, Boolean> operations | |
| TrailingOperations | back to summary |
|---|---|
| private TrailingOperations() | |
| add | back to summary |
|---|---|
| pack-priv void add(CompletionStage<?> cf) | |
| remove | back to summary |
|---|---|
| pack-priv boolean remove(CompletionStage<?> cf) | |