transport

package
v0.0.30 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type QUIC

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

QUIC implements the Transport interface to establish connections to servers using the QUIC protocol. It maintains a single connection per server, optimizing dialing times and reducing connection overhead. By leveraging streams for individual server connections, it enhances overall performance and resource utilization.

func NewQUIC

func NewQUIC(logger *slog.Logger) *QUIC

NewQUIC creates a new QUIC transport instance.

func (*QUIC) Dial

func (q *QUIC) Dial(ctx context.Context, addr string) (io.ReadWriteCloser, error)

Dial ...

type RakNet

type RakNet struct{}

RakNet implements the Transport interface to establish connections to servers using the RakNet protocol.

func NewRakNet

func NewRakNet() *RakNet

NewRakNet creates a new RakNet transport instance.

func (*RakNet) Dial

func (r *RakNet) Dial(ctx context.Context, addr string) (io.ReadWriteCloser, error)

Dial ...

type Spectral added in v0.0.29

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

Spectral implements the Transport interface to establish connections to servers using Spectral. It maintains a single connection per server, optimizing dialing times and reducing connection overhead. By leveraging streams for individual server connections, it enhances overall performance and resource utilization.

func NewSpectral added in v0.0.29

func NewSpectral(logger *slog.Logger) *Spectral

NewSpectral creates a new Spectral transport instance.

func (*Spectral) Dial added in v0.0.29

func (s *Spectral) Dial(ctx context.Context, addr string) (io.ReadWriteCloser, error)

Dial ...

type TCP

type TCP struct{}

TCP implements the Transport interface to establish connections to servers using the TCP protocol.

func NewTCP

func NewTCP() *TCP

NewTCP creates a new TCP transport instance.

func (*TCP) Dial

func (t *TCP) Dial(_ context.Context, addr string) (io.ReadWriteCloser, error)

Dial ...

type Transport

type Transport interface {
	// Dial initiates a connection to the specified address and returns an
	// io.ReadWriteCloser. The provided context is used for managing
	// timeouts and cancellations.
	Dial(ctx context.Context, addr string) (io.ReadWriteCloser, error)
}

Transport defines an interface for establishing server connections.

Jump to

Keyboard shortcuts

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