Class QuicheTripTransport
- All Implemented Interfaces:
Transport
- Direct Known Subclasses:
CompressedQuicheTripTransport
The sibling of tentackle-quic, which provides the same transport on top of KWIK. Both speak
RFC-9000 and interoperate; they register different URI schemes so that an application can use either,
or both at once, and pick per connection.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe factor by which the connection's flow control window exceeds the window of a single stream.static final intThe default QUIC max idle timeout in seconds, applied if the URI does not specifyquicidle.static final intThe default maximum number of concurrent peer-initiated bidirectional streams, applied if the URI does not specifymaxstreams.static final intThe default flow control window per stream in bytes, applied if the URI does not specifystreamwindow.static final intThe smallest flow control window accepted forstreamwindow.static final StringThe protocol name for QUIC over quiche. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept()Accepts connections from clients.voidclose()Closes this transport.protected Pool<Connection> Creates the connection pool for outgoing connections.intGets the QUIC max idle timeout in seconds.
A QUIC connection is discarded silently by both peers when it stays idle for longer than the minimum of the timeouts of both peers (see RFC-9000, 10.1).intGets the maximum number of concurrent peer-initiated bidirectional streams per QUIC connection.
On the server this is the limit advertised to the clients.intGets the flow control window per stream in bytes.
A peer may send at most that many bytes on a stream before the receiving side has to grant further credits (see RFC-9000, 4).booleanReturns true if this transport is accepting connections.Methods inherited from class AbstractTransport
createCallHandler, createConnectionHandler, createRegistry, createServerThread, getCallThreadPool, getClientDictionary, getConnection, getConnectionThreadPool, getId, getRegistry, getRemoteLookup, getServerDictionary, getTransportKey, getUri, getUriPars, isClosed, lookup, putConnection, toString
-
Field Details
-
PROTOCOL
-
DEFAULT_MAX_IDLE_SECONDS
public static final int DEFAULT_MAX_IDLE_SECONDSThe default QUIC max idle timeout in seconds, applied if the URI does not specifyquicidle.- See Also:
-
DEFAULT_MAX_STREAMS
public static final int DEFAULT_MAX_STREAMSThe default maximum number of concurrent peer-initiated bidirectional streams, applied if the URI does not specifymaxstreams.- See Also:
-
DEFAULT_STREAM_WINDOW
public static final int DEFAULT_STREAM_WINDOWThe default flow control window per stream in bytes, applied if the URI does not specifystreamwindow.- See Also:
-
CONNECTION_WINDOW_FACTOR
public static final int CONNECTION_WINDOW_FACTORThe factor by which the connection's flow control window exceeds the window of a single stream.The connection window must be larger than the stream window, or both limits would be exhausted at the very same offset and every transfer would proceed in lockstep with the credit updates. Keeping the connection window a multiple of the stream window makes the stream limit the binding one.
Note that the connection window is shared by all streams of the connection, so the stream limit is the binding one only as long as fewer than this many streams transfer at full window at the same time. Sizing
streamwindowso that ordinary calls fit into it keeps the number of streams that are blocked on flow control small.- See Also:
-
MIN_STREAM_WINDOW
public static final int MIN_STREAM_WINDOWThe smallest flow control window accepted forstreamwindow.A window must hold at least one maximum-sized QUIC packet.
- See Also:
-
-
Constructor Details
-
QuicheTripTransport
Creates a new QUIC transport.- Parameters:
uri- the URI of the transport
-
-
Method Details
-
accept
public void accept()Description copied from interface:TransportAccepts connections from clients.- Specified by:
acceptin interfaceTransport- Overrides:
acceptin classAbstractTransport
-
isAccepting
public boolean isAccepting()Description copied from interface:TransportReturns true if this transport is accepting connections.- Returns:
- true if accepting, false otherwise
-
getMaxIdleSeconds
public int getMaxIdleSeconds()Gets the QUIC max idle timeout in seconds.
A QUIC connection is discarded silently by both peers when it stays idle for longer than the minimum of the timeouts of both peers (see RFC-9000, 10.1). The same value is configured on the server and on the client, so that the effective timeout is well-defined.Note that this has nothing to do with the
idleparameter, which is the timeout in minutes after which the connection pool closes unused connections.- Returns:
- the timeout in seconds
-
getMaxStreams
public int getMaxStreams()Gets the maximum number of concurrent peer-initiated bidirectional streams per QUIC connection.
On the server this is the limit advertised to the clients. On the client it bounds the size of the connection pool, since every pooled connection holds one stream for as long as it is in the pool (seeQuicheTripConnectionPool).- Returns:
- the maximum number of streams, always ≥ 1
-
getStreamWindow
public int getStreamWindow()Gets the flow control window per stream in bytes.
A peer may send at most that many bytes on a stream before the receiving side has to grant further credits (see RFC-9000, 4). The window should be at least as large as the largest call to be transferred without intermediate credit updates. The connection window is a multiple of it, seeCONNECTION_WINDOW_FACTOR.- Returns:
- the window in bytes
-
close
public void close()Closes this transport.Overridden to shut down the QUIC endpoint, which releases the UDP socket and terminates the connections of all clients.
The endpoint is closed before the transport's thread pools are shut down, so that no incoming stream is dispatched to a pool that is already gone. Closing it waits for the client connections to terminate, which is why it happens outside the transport's monitor: connection handlers still running must be able to invoke synchronized transport methods.
- Specified by:
closein interfaceTransport- Overrides:
closein classAbstractTransport
-
createClientConnectionPool
Description copied from class:AbstractTransportCreates the connection pool for outgoing connections.- Specified by:
createClientConnectionPoolin classAbstractTransport- Returns:
- the connection pool
-