client

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2025 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientConfig

type ClientConfig struct {
	// Delimiter is used to frame messages (default: "\n\n\n")
	Delimiter []byte
	// ReadTimeout is the timeout for read operations
	ReadTimeout time.Duration
	// WriteTimeout is the timeout for write operations
	WriteTimeout time.Duration
	// BufferSize is the size of the read buffer
	BufferSize int
	// ProtocolConfig holds protocol-specific configuration
	ProtocolConfig interface{}
}

ClientConfig holds common configuration for all protocol clients

func DefaultConfig

func DefaultConfig() *ClientConfig

DefaultConfig returns a ClientConfig with default values

type QUICClient

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

QUICClient implements a QUIC connection client

func NewQUICClient

func NewQUICClient(addr string, config *ClientConfig) (*QUICClient, error)

NewQUICClient creates a new QUIC client with the given address

func (*QUICClient) Close

func (c *QUICClient) Close() error

Close closes the QUIC connection

func (*QUICClient) Connect

func (c *QUICClient) Connect(ctx context.Context) error

Connect establishes a QUIC connection

func (*QUICClient) LocalAddr

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

LocalAddr returns the local network address

func (*QUICClient) Receive

func (c *QUICClient) Receive() ([]byte, error)

Receive receives data from the QUIC connection

func (*QUICClient) RemoteAddr

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

RemoteAddr returns the remote network address

func (*QUICClient) Send

func (c *QUICClient) Send(data []byte) error

Send sends data over the QUIC connection

type QUICConfig

type QUICConfig struct {
	InsecureSkipVerify bool
	NextProtos         []string
	MinVersion         uint16
}

Protocol-specific configurations

type UDPClient

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

UDPClient implements a UDP connection client

func NewUDPClient

func NewUDPClient(addr string, config *ClientConfig) (*UDPClient, error)

NewUDPClient creates a new UDP client with the given address

func (*UDPClient) Close

func (c *UDPClient) Close() error

Close closes the UDP connection

func (*UDPClient) Connect

func (c *UDPClient) Connect(ctx context.Context) error

Connect establishes a UDP connection

func (*UDPClient) LocalAddr

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

LocalAddr returns the local network address

func (*UDPClient) Receive

func (c *UDPClient) Receive() ([]byte, error)

Receive receives data from the UDP connection

func (*UDPClient) RemoteAddr

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

RemoteAddr returns the remote network address

func (*UDPClient) Send

func (c *UDPClient) Send(data []byte) error

Send sends data over the UDP connection

Jump to

Keyboard shortcuts

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