A typical call flow to establish a connection would be:
AltService service = ...;
QuicClient client = ...;
QuicConnection connection = client.createConnectionFor(service);
connection.startHandshake()
.thenApply((r) -> { ... })
...;
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public abstract void | addRemoteStreamListener(Predicate<? super QuicReceiverStream>
the listener streamConsumer)Adds a listener that will be invoked when a remote stream is created. |
| public abstract ConnectionTerminator | Returns: theConnectionTerminator for this connectionReturns the |
| public abstract String | Returns: a debug tag to be used with lower level loggingReturns a debug tag to be used with lower level logging. |
| public abstract QuicTLSEngine | |
| public abstract CompletableFuture | handshakeReachedPeer()
{@return a |
| public abstract boolean | |
| public abstract SocketAddress | |
| public QuicConnectionId | Returns: this connectionQuicConnectionId or nullReturns this connection |
| public abstract String | |
| public abstract CompletableFuture | Returns: a CompletableFuture which completes either with a new locally initiated bidirectional stream or exceptionally if the stream creation failedAmount of time to wait for the bidirectional stream creation
limit to be increased by the peer, if this connection has
currently reached its limit limitIncreaseDuration)Creates a new locally initiated bidirectional stream. |
| public abstract CompletableFuture | Returns: a CompletableFuture which completes either with a new locally initiated unidirectional stream or exceptionally if the stream creation failedAmount of time to wait for the unidirectional stream creation
limit to be increased by the peer, if this connection has
currently reached its limit limitIncreaseDuration)Creates a new locally initiated unidirectional stream. |
| public abstract InetSocketAddress | |
| public abstract Stream | Returns: a stream of all currently openedQuicStream in the connectionReturns a stream of all currently opened |
| public abstract boolean | Returns: true if the listener was found and removed, false otherwiseRemoves a listener previously added with |
| public abstract CompletableFuture | Returns: A completable future that will be completed with the number of milliseconds it took to get a valid response. It may also complete exceptionally, or with-1L if the ping was not sent.Requests to send a PING frame to the peer. |
| public abstract CompletableFuture | Returns: A completable future which will be completed when the handshake is completed.Starts the Quic Handshake. |
| public abstract TerminationCause | Returns: theTerminationCause if the connection has
closed or is being closed, otherwise returns nullReturns the |
| public long | Returns: a long identifier that can be used to uniquely identify a quic connection in the context of theQuicInstance that created itReturns a long identifier that can be used to uniquely
identify a quic connection in the context of the
|
| QuicConnection | back to summary |
|---|---|
| public QuicConnection() | |
| addRemoteStreamListener | back to summary |
|---|---|
| public abstract void addRemoteStreamListener(Predicate<? super QuicReceiverStream> streamConsumer) Adds a listener that will be invoked when a remote stream is created. API Note The listener will be invoked with any remote streams
already opened, and not yet acquired by another listener.
Any stream passed to the listener is either a
| |
| connectionTerminator | back to summary |
|---|---|
| public abstract ConnectionTerminator connectionTerminator() Returns the
| |
| dbgTag | back to summary |
|---|---|
| public abstract String dbgTag() Returns a debug tag to be used with lower level logging.
This typically includes both the connection
| |
| getTLSEngine | back to summary |
|---|---|
| public abstract QuicTLSEngine getTLSEngine() | |
| handshakeReachedPeer | back to summary |
|---|---|
| public abstract CompletableFuture {@return a | |
| isOpen | back to summary |
|---|---|
| public abstract boolean isOpen() Returns true if this connection is open.
| |
| localAddress | back to summary |
|---|---|
| public abstract SocketAddress localAddress() | |
| localConnectionId | back to summary |
|---|---|
| public QuicConnectionId localConnectionId() Returns this connection Implementation Specification The default implementation of this method returns null
| |
| logTag | back to summary |
|---|---|
| public abstract String logTag() Returns a debug tag. Typically used with higher level logging
| |
| openNewLocalBidiStream | back to summary |
|---|---|
| public abstract CompletableFuture Creates a new locally initiated bidirectional stream.
Creation of streams is limited to the maximum limit advertised by the peer. If a new stream
cannot be created due to this limitation, then this method will use the
If the limit has been reached and the
| |
| openNewLocalUniStream | back to summary |
|---|---|
| public abstract CompletableFuture Creates a new locally initiated unidirectional stream. Locally created unidirectional streams are write-only streams.
Creation of streams is limited to the maximum limit advertised by the peer. If a new stream
cannot be created due to this limitation, then this method will use the
If the limit has been reached and the
| |
| peerAddress | back to summary |
|---|---|
| public abstract InetSocketAddress peerAddress() | |
| quicStreams | back to summary |
|---|---|
| public abstract Stream Returns a stream of all currently opened API Note All current quic streams are included, whether local or remote, and whether they have been acquired or not.
| |
| removeRemoteStreamListener | back to summary |
|---|---|
| public abstract boolean removeRemoteStreamListener(Predicate<? super QuicReceiverStream> streamConsumer) Removes a listener previously added with
| |
| requestSendPing | back to summary |
|---|---|
| public abstract CompletableFuture Requests to send a PING frame to the peer.
An implementation may decide to support sending of out-of-band ping
frames (triggered by the application layer) only for a subset of the
packet number spaces. It may complete with -1 if it doesn't want to request
sending of a ping frame at the time
| |
| startHandshake | back to summary |
|---|---|
| public abstract CompletableFuture Starts the Quic Handshake.
| |
| terminationCause | back to summary |
|---|---|
| public abstract TerminationCause terminationCause() Returns the
| |
| uniqueId | back to summary |
|---|---|
| public long uniqueId() Returns a long identifier that can be used to uniquely
identify a quic connection in the context of the
| |