quic

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient added in v0.3.3

func NewClient(config *protocol.Protocol_Quic) point.WrapProxy

func NewFragFrameBytesBuffer added in v0.3.3

func NewFragFrameBytesBuffer(t FragType, id uint64, total, current uint8, payload []byte) []byte

every frame max length: 1200 - 3

Single Frame max payload length: 1200 - 3 - 1 +-------+~~~~~~~~~~~~~~+ | type | payload | +-------+~~~~~~~~~~~~~~+ | 1 | variable | +-------+~~~~~~~~~~~~~~+

Split Frame max payload length: 1200 - 3 - 1 - 8 - 1 - 1 +------+------------------+---------+---------+~~~~~~~~~~~~~~+ | type | id | total | current | payload | +------+------------------+---------+---------+~~~~~~~~~~~~~~+ | 1 | 8 bytes | 1 byte | 1 byte | variable | +------+------------------+---------+---------+~~~~~~~~~~~~~~+

func NewServer

func NewServer(c *listener.Inbound_Quic) (netapi.Listener, error)

Types

type Client

type Client struct {
	netapi.EmptyDispatch
	// contains filtered or unexported fields
}

func (*Client) Conn

func (c *Client) Conn(ctx context.Context, s netapi.Address) (net.Conn, error)

func (*Client) PacketConn

func (c *Client) PacketConn(ctx context.Context, host netapi.Address) (net.PacketConn, error)

type ConnectionPacketConn

type ConnectionPacketConn struct {
	MaxDatagramFrameSize *atomic.Int64
	// contains filtered or unexported fields
}

func NewConnectionPacketConn

func NewConnectionPacketConn(conn quic.Connection) *ConnectionPacketConn

func (*ConnectionPacketConn) Context added in v0.3.3

func (c *ConnectionPacketConn) Context() context.Context

func (*ConnectionPacketConn) Receive

func (*ConnectionPacketConn) Write

func (c *ConnectionPacketConn) Write(b []byte, id uint64) error

type Frag

type Frag struct {
	SplitID atomic.Uint64
	// contains filtered or unexported fields
}

func (*Frag) Merge

func (f *Frag) Merge(buf []byte) *pool.Buffer

func (*Frag) Split

func (f *Frag) Split(buf []byte, maxSize int) [][]byte

type FragType added in v0.3.3

type FragType uint8
const (
	FragmentTypeSplit FragType = iota + 1
	FragmentTypeSingle
)

type MergeFrag

type MergeFrag struct {
	Data     [][]byte
	Count    uint32
	Total    uint32
	TotalLen uint32
	// contains filtered or unexported fields
}

type QuicAddr

type QuicAddr struct {
	Addr net.Addr
	ID   quic.StreamID
	// contains filtered or unexported fields
}

func (*QuicAddr) Network

func (q *QuicAddr) Network() string

func (*QuicAddr) String

func (q *QuicAddr) String() string

type Server

type Server struct {
	*quic.Listener
	// contains filtered or unexported fields
}

func (*Server) Accept

func (s *Server) Accept() (net.Conn, error)

func (*Server) Close

func (s *Server) Close() error

func (*Server) Packet added in v0.3.3

func (s *Server) Packet(context.Context) (net.PacketConn, error)

func (*Server) Stream added in v0.3.3

func (s *Server) Stream(ctx context.Context) (net.Listener, error)

Jump to

Keyboard shortcuts

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