Class SentPacket
java.lang.Object
io.github.mahmoudimus.quic.connection.SentPacket
What loss recovery remembers about a sent packet until it is acknowledged or deemed lost (RFC
9002 appendix A.1.1). Stream data is not copied:
streamFrames() only names the ranges.
Threads. Not thread-safe; owned by one connection.
-
Constructor Summary
ConstructorsConstructorDescriptionSentPacket(long timeSent, int size, boolean ackEliciting, long largestAcked, Retransmits retransmits, List<StreamMeta> streamFrames) A sent packet. -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether the packet must be acknowledged.longThe bytes the connection had delivered when this packet was sent (P.delivered).longWhen the connection's delivered count last changed before this packet was sent (P.delivered_time).longThe send time of the first packet of the flight this one was sent in (P.first_sent_time).booleanWhether the packet was sent while sending was application limited (P.is_app_limited).longThe largest packet number the packet's ACK frame acknowledged.static SentPacketof(long timeSent, int size, boolean ackEliciting) A packet without frames to track, for tests and ACK-only packets.longThe generation of the path the packet was sent on.The control frames the packet carried.intsize()The bytes the packet counts in flight.The STREAM frames the packet carried.longtimeSent()When the packet was sent.
-
Constructor Details
-
SentPacket
public SentPacket(long timeSent, int size, boolean ackEliciting, long largestAcked, Retransmits retransmits, List<StreamMeta> streamFrames) A sent packet.- Parameters:
timeSent- when it was sent, in nanosecondssize- its size in bytes, QUIC framing included but not UDP or IP; zero if it is not counted in flight (an ACK-only packet that is not padded)ackEliciting- whether it must be acknowledgedlargestAcked- the largest packet number its ACK frame acknowledged, or -1retransmits- the control frames it carried, to queue again if it is lost; may be nullstreamFrames- the STREAM frames it carried
-
-
Method Details
-
of
A packet without frames to track, for tests and ACK-only packets.- Parameters:
timeSent- when it was sentsize- its size, zero if not in flightackEliciting- whether it must be acknowledged- Returns:
- the packet
-
timeSent
public long timeSent()When the packet was sent.- Returns:
- nanoseconds
-
size
public int size()The bytes the packet counts in flight.- Returns:
- the size, zero if not in flight
-
ackEliciting
public boolean ackEliciting()Whether the packet must be acknowledged.- Returns:
- true if it carried a frame other than ACK, PADDING and CONNECTION_CLOSE
-
largestAcked
public long largestAcked()The largest packet number the packet's ACK frame acknowledged.- Returns:
- the packet number, or -1 if it carried no ACK
-
retransmits
The control frames the packet carried.- Returns:
- the frames, or null if none
-
streamFrames
The STREAM frames the packet carried.- Returns:
- what each one carried
-
delivered
public long delivered()The bytes the connection had delivered when this packet was sent (P.delivered).- Returns:
- bytes
-
deliveredTime
public long deliveredTime()When the connection's delivered count last changed before this packet was sent (P.delivered_time).- Returns:
- the time, or
Long.MIN_VALUEif the packet was not in flight
-
firstSentTime
public long firstSentTime()The send time of the first packet of the flight this one was sent in (P.first_sent_time).- Returns:
- the time, or
Long.MIN_VALUEif the packet was not in flight
-
isAppLimited
public boolean isAppLimited()Whether the packet was sent while sending was application limited (P.is_app_limited).- Returns:
- the flag
-
pathGeneration
public long pathGeneration()The generation of the path the packet was sent on.- Returns:
- the generation
-