Documentation ¶
Index ¶
- func HasAckElicitingFrames(fs []Frame) bool
- func IsFrameAckEliciting(f wire.Frame) bool
- func NewAckHandler(initialPacketNumber protocol.PacketNumber, ...) (SentPacketHandler, ReceivedPacketHandler)
- type Frame
- type FrameHandler
- type ReceivedPacketHandler
- type SendMode
- type SentPacketHandler
- type StreamFrame
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasAckElicitingFrames ¶ added in v0.32.0
HasAckElicitingFrames returns true if at least one frame is ack-eliciting.
func IsFrameAckEliciting ¶ added in v0.32.0
IsFrameAckEliciting returns true if the frame is ack-eliciting.
func NewAckHandler ¶ added in v0.32.0
func NewAckHandler( initialPacketNumber protocol.PacketNumber, initialMaxDatagramSize protocol.ByteCount, rttStats *utils.RTTStats, clientAddressValidated bool, enableECN bool, pers protocol.Perspective, tracer *logging.ConnectionTracer, logger utils.Logger, ) (SentPacketHandler, ReceivedPacketHandler)
NewAckHandler creates a new SentPacketHandler and a new ReceivedPacketHandler. clientAddressValidated indicates whether the address was validated beforehand by an address validation token. clientAddressValidated has no effect for a client.
Types ¶
type Frame ¶ added in v0.32.0
type Frame struct { Frame wire.Frame // nil if the frame has already been acknowledged in another packet Handler FrameHandler }
type FrameHandler ¶ added in v0.36.0
FrameHandler handles the acknowledgement and the loss of a frame.
type ReceivedPacketHandler ¶
type ReceivedPacketHandler interface { IsPotentiallyDuplicate(protocol.PacketNumber, protocol.EncryptionLevel) bool ReceivedPacket(pn protocol.PacketNumber, ecn protocol.ECN, encLevel protocol.EncryptionLevel, rcvTime time.Time, ackEliciting bool) error DropPackets(protocol.EncryptionLevel) GetAlarmTimeout() time.Time GetAckFrame(encLevel protocol.EncryptionLevel, onlyIfQueued bool) *wire.AckFrame }
ReceivedPacketHandler handles ACKs needed to send for incoming packets
type SendMode ¶ added in v0.8.0
type SendMode uint8
The SendMode says what kind of packets can be sent.
const ( // SendNone means that no packets should be sent SendNone SendMode = iota // SendAck means an ACK-only packet should be sent SendAck // SendPTOInitial means that an Initial probe packet should be sent SendPTOInitial // SendPTOHandshake means that a Handshake probe packet should be sent SendPTOHandshake // SendPTOAppData means that an Application data probe packet should be sent SendPTOAppData // SendPacingLimited means that the pacer doesn't allow sending of a packet right now, // but will do in a little while. // The timestamp when sending is allowed again can be obtained via the SentPacketHandler.TimeUntilSend. SendPacingLimited // SendAny means that any packet should be sent SendAny )
type SentPacketHandler ¶
type SentPacketHandler interface { // SentPacket may modify the packet SentPacket(t time.Time, pn, largestAcked protocol.PacketNumber, streamFrames []StreamFrame, frames []Frame, encLevel protocol.EncryptionLevel, ecn protocol.ECN, size protocol.ByteCount, isPathMTUProbePacket bool) // ReceivedAck processes an ACK frame. // It does not store a copy of the frame. ReceivedAck(f *wire.AckFrame, encLevel protocol.EncryptionLevel, rcvTime time.Time) (bool, error) ReceivedBytes(protocol.ByteCount) DropPackets(protocol.EncryptionLevel) ResetForRetry(rcvTime time.Time) error SetHandshakeConfirmed() // The SendMode determines if and what kind of packets can be sent. SendMode(now time.Time) SendMode // TimeUntilSend is the time when the next packet should be sent. // It is used for pacing packets. TimeUntilSend() time.Time SetMaxDatagramSize(count protocol.ByteCount) // only to be called once the handshake is complete QueueProbePacket(protocol.EncryptionLevel) bool /* was a packet queued */ ECNMode(isShortHeaderPacket bool) protocol.ECN // isShortHeaderPacket should only be true for non-coalesced 1-RTT packets PeekPacketNumber(protocol.EncryptionLevel) (protocol.PacketNumber, protocol.PacketNumberLen) PopPacketNumber(protocol.EncryptionLevel) protocol.PacketNumber GetLossDetectionTimeout() time.Time OnLossDetectionTimeout() error }
SentPacketHandler handles ACKs received for outgoing packets
type StreamFrame ¶ added in v0.36.0
type StreamFrame struct { Frame *wire.StreamFrame Handler FrameHandler }
Click to show internal directories.
Click to hide internal directories.