quic-go: github.com/lucas-clemente/quic-go/internal/ackhandler Index | Files

package ackhandler

import "github.com/lucas-clemente/quic-go/internal/ackhandler"

Index

Package Files

ack_eliciting.go frame.go gen.go interfaces.go packet_linkedlist.go packet_number_generator.go received_packet_handler.go received_packet_history.go received_packet_tracker.go send_mode.go sent_packet_handler.go sent_packet_history.go

func HasAckElicitingFrames Uses

func HasAckElicitingFrames(fs []Frame) bool

HasAckElicitingFrames returns true if at least one frame is ack-eliciting.

func IsFrameAckEliciting Uses

func IsFrameAckEliciting(f wire.Frame) bool

IsFrameAckEliciting returns true if the frame is ack-eliciting.

type Frame Uses

type Frame struct {
    wire.Frame // nil if the frame has already been acknowledged in another packet
    OnLost     func(wire.Frame)
    OnAcked    func(wire.Frame)
}

type Packet Uses

type Packet struct {
    PacketNumber    protocol.PacketNumber
    Frames          []Frame
    LargestAcked    protocol.PacketNumber // InvalidPacketNumber if the packet doesn't contain an ACK
    Length          protocol.ByteCount
    EncryptionLevel protocol.EncryptionLevel
    SendTime        time.Time
    // contains filtered or unexported fields
}

A Packet is a packet

type PacketElement Uses

type PacketElement struct {

    // The value stored with this element.
    Value Packet
    // contains filtered or unexported fields
}

PacketElement is an element of a linked list.

func (*PacketElement) Next Uses

func (e *PacketElement) Next() *PacketElement

Next returns the next list element or nil.

func (*PacketElement) Prev Uses

func (e *PacketElement) Prev() *PacketElement

Prev returns the previous list element or nil.

type PacketList Uses

type PacketList struct {
    // contains filtered or unexported fields
}

PacketList is a linked list of Packets.

func NewPacketList Uses

func NewPacketList() *PacketList

NewPacketList returns an initialized list.

func (*PacketList) Back Uses

func (l *PacketList) Back() *PacketElement

Back returns the last element of list l or nil if the list is empty.

func (*PacketList) Front Uses

func (l *PacketList) Front() *PacketElement

Front returns the first element of list l or nil if the list is empty.

func (*PacketList) Init Uses

func (l *PacketList) Init() *PacketList

Init initializes or clears list l.

func (*PacketList) InsertAfter Uses

func (l *PacketList) InsertAfter(v Packet, mark *PacketElement) *PacketElement

InsertAfter inserts a new element e with value v immediately after mark and returns e. If mark is not an element of l, the list is not modified. The mark must not be nil.

func (*PacketList) InsertBefore Uses

func (l *PacketList) InsertBefore(v Packet, mark *PacketElement) *PacketElement

InsertBefore inserts a new element e with value v immediately before mark and returns e. If mark is not an element of l, the list is not modified. The mark must not be nil.

func (*PacketList) Len Uses

func (l *PacketList) Len() int

Len returns the number of elements of list l. The complexity is O(1).

func (*PacketList) MoveAfter Uses

func (l *PacketList) MoveAfter(e, mark *PacketElement)

MoveAfter moves element e to its new position after mark. If e or mark is not an element of l, or e == mark, the list is not modified. The element and mark must not be nil.

func (*PacketList) MoveBefore Uses

func (l *PacketList) MoveBefore(e, mark *PacketElement)

MoveBefore moves element e to its new position before mark. If e or mark is not an element of l, or e == mark, the list is not modified. The element and mark must not be nil.

func (*PacketList) MoveToBack Uses

func (l *PacketList) MoveToBack(e *PacketElement)

MoveToBack moves element e to the back of list l. If e is not an element of l, the list is not modified. The element must not be nil.

func (*PacketList) MoveToFront Uses

func (l *PacketList) MoveToFront(e *PacketElement)

MoveToFront moves element e to the front of list l. If e is not an element of l, the list is not modified. The element must not be nil.

func (*PacketList) PushBack Uses

func (l *PacketList) PushBack(v Packet) *PacketElement

PushBack inserts a new element e with value v at the back of list l and returns e.

func (*PacketList) PushBackList Uses

func (l *PacketList) PushBackList(other *PacketList)

PushBackList inserts a copy of an other list at the back of list l. The lists l and other may be the same. They must not be nil.

func (*PacketList) PushFront Uses

func (l *PacketList) PushFront(v Packet) *PacketElement

PushFront inserts a new element e with value v at the front of list l and returns e.

func (*PacketList) PushFrontList Uses

func (l *PacketList) PushFrontList(other *PacketList)

PushFrontList inserts a copy of an other list at the front of list l. The lists l and other may be the same. They must not be nil.

func (*PacketList) Remove Uses

func (l *PacketList) Remove(e *PacketElement) Packet

Remove removes e from l if e is an element of list l. It returns the element value e.Value. The element must not be nil.

type ReceivedPacketHandler Uses

type ReceivedPacketHandler interface {
    ReceivedPacket(pn protocol.PacketNumber, encLevel protocol.EncryptionLevel, rcvTime time.Time, shouldInstigateAck bool)
    IgnoreBelow(protocol.PacketNumber)
    DropPackets(protocol.EncryptionLevel)

    GetAlarmTimeout() time.Time
    GetAckFrame(protocol.EncryptionLevel) *wire.AckFrame
}

ReceivedPacketHandler handles ACKs needed to send for incoming packets

func NewReceivedPacketHandler Uses

func NewReceivedPacketHandler(
    rttStats *congestion.RTTStats,
    logger utils.Logger,
    version protocol.VersionNumber,
) ReceivedPacketHandler

NewReceivedPacketHandler creates a new receivedPacketHandler

type SendMode Uses

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
    // SendPTO means that a probe packet should be sent
    SendPTO
    // SendAny means that any packet should be sent
    SendAny
)

func (SendMode) String Uses

func (s SendMode) String() string

type SentPacketHandler Uses

type SentPacketHandler interface {
    // SentPacket may modify the packet
    SentPacket(packet *Packet)
    ReceivedAck(ackFrame *wire.AckFrame, withPacketNumber protocol.PacketNumber, encLevel protocol.EncryptionLevel, recvTime time.Time) error
    DropPackets(protocol.EncryptionLevel)
    ResetForRetry() error

    // The SendMode determines if and what kind of packets can be sent.
    SendMode() SendMode
    // TimeUntilSend is the time when the next packet should be sent.
    // It is used for pacing packets.
    TimeUntilSend() time.Time
    // ShouldSendNumPackets returns the number of packets that should be sent immediately.
    // It always returns a number greater or equal than 1.
    // A number greater than 1 is returned when the pacing delay is smaller than the minimum pacing delay.
    // Note that the number of packets is only calculated based on the pacing algorithm.
    // Before sending any packet, SendingAllowed() must be called to learn if we can actually send it.
    ShouldSendNumPackets() int

    // only to be called once the handshake is complete
    GetLowestPacketNotConfirmedAcked() protocol.PacketNumber
    QueueProbePacket() bool /* was a packet queued */

    PeekPacketNumber(protocol.EncryptionLevel) (protocol.PacketNumber, protocol.PacketNumberLen)
    PopPacketNumber(protocol.EncryptionLevel) protocol.PacketNumber

    GetLossDetectionTimeout() time.Time
    OnLossDetectionTimeout() error

    // report some congestion statistics. For tracing only.
    GetStats() *quictrace.TransportState
}

SentPacketHandler handles ACKs received for outgoing packets

func NewSentPacketHandler Uses

func NewSentPacketHandler(
    initialPacketNumber protocol.PacketNumber,
    rttStats *congestion.RTTStats,
    traceCallback func(quictrace.Event),
    logger utils.Logger,
) SentPacketHandler

NewSentPacketHandler creates a new sentPacketHandler

Package ackhandler imports 10 packages (graph) and is imported by 9 packages. Updated 2019-09-17. Refresh now. Tools for package owners.