transport

package
v0.0.23 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2024 License: MIT Imports: 11 Imported by: 0

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(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(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(addr string) (io.ReadWriteCloser, error)

Dial ...

type Transport

type Transport interface {
	// Dial connects to the specified address and returns an io.ReadWriteCloser.
	// It returns an error if the connection cannot be established.
	Dial(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