tpuquic

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ALPNTPUProtocolID = "solana-tpu"
	DefaultCommonName = "Solana node"
)
View Source
const (
	DefaultCount           = 3
	DefaultInterval        = 3 * time.Second
	DefaultKeepAlivePeriod = 500 * time.Millisecond
)

Variables

View Source
var (
	DefaultSrc = net.UDPAddr{IP: net.ParseIP("0.0.0.0"), Port: 0}
)

Functions

This section is empty.

Types

type Conn

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

func Dial

func Dial(ctx context.Context, dst string, cfg *DialConfig) (*Conn, error)

func (*Conn) Close

func (c *Conn) Close() error

func (*Conn) ConnectionStats

func (c *Conn) ConnectionStats() quic.ConnectionStats

func (*Conn) Context

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

func (*Conn) IsClosed

func (c *Conn) IsClosed() bool

func (*Conn) LocalAddr

func (c *Conn) LocalAddr() net.Addr

func (*Conn) RemoteAddr

func (c *Conn) RemoteAddr() net.Addr

type DialConfig

type DialConfig struct {
	Interface string
	Src       string

	MaxIdleTimeout       time.Duration
	HandshakeIdleTimeout time.Duration
	KeepAlivePeriod      time.Duration
}

func (*DialConfig) Validate

func (cfg *DialConfig) Validate() error

type MaybeTick

type MaybeTick struct {
	C <-chan time.Time
	// contains filtered or unexported fields
}

func NewMaybeTick

func NewMaybeTick(d time.Duration, clock clockwork.Clock) *MaybeTick

func (*MaybeTick) Stop

func (m *MaybeTick) Stop()

type PingConfig

type PingConfig struct {
	DialConfig

	Count    int
	Interval time.Duration

	Clock clockwork.Clock
}

func (*PingConfig) Validate

func (cfg *PingConfig) Validate() error

type PingResult

type PingResult struct {
	ConnectionStats []quic.ConnectionStats `json:"connection_stats"`
	Success         bool                   `json:"success"`
	Error           error                  `json:"error"`
}

func Ping

func Ping(ctx context.Context, log *slog.Logger, dst string, cfg PingConfig) (*PingResult, error)

Jump to

Keyboard shortcuts

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