Class Retransmits
java.lang.Object
io.github.mahmoudimus.quic.connection.Retransmits
Control frames waiting to be sent in one packet number space, and, attached to a
SentPacket, the control frames that packet carried, to queue again if it is lost.
Most entries record only that a frame is needed; its current value is computed when the
packet is built, so a retransmission carries fresh limits (RFC 9000 section 13.3). Stream data
itself is not here: it stays in the streams' SendBuffers.
This is a plain mutable holder of public fields. Threads: not thread-safe; owned by one connection.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA RESET_STREAM to send. -
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanWhether an ACK_FREQUENCY is needed.final ArrayDeque<Frame.Crypto> CRYPTO frames to send, retransmissions first.booleanWhether a DATA_BLOCKED is needed.booleanWhether a HANDSHAKE_DONE is needed.booleanWhether a MAX_DATA is needed.Streams that need a MAX_STREAM_DATA.final boolean[]Whether a MAX_STREAMS is needed, indexed byEnum.ordinal().NEW_CONNECTION_ID frames to send.final List<InetSocketAddress> One entry per NEW_TOKEN frame to send, holding the path's remote address: a lost token is replaced by a fresh one, and only for the path it was meant for.final List<Retransmits.PendingReset> RESET_STREAM frames to send.Sequence numbers to retire in RETIRE_CONNECTION_ID frames.final List<Frame.StopSending> STOP_SENDING frames to send.Streams that need a STREAM_DATA_BLOCKED.final boolean[]Whether a STREAMS_BLOCKED is needed, indexed byEnum.ordinal(). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisEmpty(StreamsState streams) Whether nothing needs sending.voidmerge(Retransmits other) Merges another set of pending frames into this one.voidretireCids(long start, long end) Queues RETIRE_CONNECTION_ID frames for a range of sequence numbers.
-
Field Details
-
maxData
public boolean maxDataWhether a MAX_DATA is needed. -
dataBlocked
public boolean dataBlockedWhether a DATA_BLOCKED is needed. -
maxStreamId
public final boolean[] maxStreamIdWhether a MAX_STREAMS is needed, indexed byEnum.ordinal(). -
streamsBlocked
public final boolean[] streamsBlockedWhether a STREAMS_BLOCKED is needed, indexed byEnum.ordinal(). -
resetStream
RESET_STREAM frames to send. -
stopSending
STOP_SENDING frames to send. -
maxStreamData
Streams that need a MAX_STREAM_DATA. -
streamDataBlocked
Streams that need a STREAM_DATA_BLOCKED. -
crypto
CRYPTO frames to send, retransmissions first. -
newCids
NEW_CONNECTION_ID frames to send. -
retireCids
Sequence numbers to retire in RETIRE_CONNECTION_ID frames. -
ackFrequency
public boolean ackFrequencyWhether an ACK_FREQUENCY is needed. -
handshakeDone
public boolean handshakeDoneWhether a HANDSHAKE_DONE is needed. -
newTokens
One entry per NEW_TOKEN frame to send, holding the path's remote address: a lost token is replaced by a fresh one, and only for the path it was meant for.
-
-
Constructor Details
-
Retransmits
public Retransmits()Nothing pending.
-
-
Method Details
-
retireCids
Queues RETIRE_CONNECTION_ID frames for a range of sequence numbers.- Parameters:
start- the first sequence numberend- one past the last- Throws:
QuicException-CONNECTION_ID_LIMIT_ERRORif too many would be queued, which only a peer that keeps retiring connection IDs causes
-
isEmpty
Whether nothing needs sending. Stream entries count only while still meaningful: a MAX_STREAM_DATA for a stream that no longer takes data, or a blocked frame whose limit the peer has since raised, does not.- Parameters:
streams- the connection's streams- Returns:
- true if no frame is needed
-
merge
Merges another set of pending frames into this one. CRYPTO frames fromothergo first, which reduces head-of-line blocking when they are retransmissions.- Parameters:
other- the frames to add; not changed
-