respool

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package respool contains the Dispatcher's pool of free buffers/packets.

FIXME(scrye): Currently the pools are elastic, but this is not ideal for traffic bursts. Consider converting these to fixed-size lists.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBuffer

func GetBuffer() common.RawBytes

func PutBuffer

func PutBuffer(b common.RawBytes)

Types

type Packet

type Packet struct {
	Info          spkt.ScnPkt
	OverlayRemote *net.UDPAddr
	// contains filtered or unexported fields
}

Packet describes a SCION packet. Fields might reference each other (including hidden fields), so callers should only write to freshly created packets, and readers should take care never to mutate data.

func GetPacket

func GetPacket() *Packet

func (*Packet) DecodeFromConn

func (pkt *Packet) DecodeFromConn(conn net.PacketConn) error

func (*Packet) DecodeFromReliableConn

func (pkt *Packet) DecodeFromReliableConn(conn net.PacketConn) error

func (*Packet) Dup

func (pkt *Packet) Dup()

Dup increases pkt's reference count.

Dup panics if it is called after the packet has been freed (i.e., it's reference count reached 0).

Modifying a packet after the first call to Dup is racy, and callers should use external locking for it.

func (*Packet) Free

func (pkt *Packet) Free()

Free releases a reference to the packet. Free is safe to use from concurrent goroutines.

func (*Packet) Len

func (p *Packet) Len() int

Len returns the length of the packet.

func (*Packet) SendOnConn

func (pkt *Packet) SendOnConn(conn net.PacketConn, address net.Addr) (int, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL