transport

package
v1.8.5 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPackageLoss     = errors.New("package loss")
	ErrUserNotFound    = errors.New("user not found")
	ErrRequestNotFound = errors.New("request not found")
	ErrTargetACKFailed = errors.New("target ack failed")
	ErrServerFailed    = errors.New("server error")
	ErrBadRequest      = errors.New("bad request")
	ErrBlocked         = errors.New("blocked")
	ErrNotImplemented  = errors.New("not implemented")
)
View Source
var BufferSize = 64 * 1024

BufferSize 64K (1K == 1024 Byte)

View Source
var DialTimeout = 3 * time.Minute

DialTimeout for transport of direct

View Source
var Network = "tcp"

Network is a tcp dial option

Functions

func AllocateBuffer added in v1.8.3

func AllocateBuffer() []byte

func DisableIPv6

func DisableIPv6()

DisableIPv6 for dial

func SetBufferSize

func SetBufferSize(size uint16)

SetBufferSize in KB

func SetNetwork

func SetNetwork(network string)

SetNetwork to tcp4 or tcp6

Types

type Request

type Request struct {
	Host string
	Port uint16
}

func NewRequest

func NewRequest(host string, port uint16) *Request

type Transport

type Transport interface {
	String() string
	Proxy(ctx context.Context, req *Request, localAddr chan<- string, dst io.Writer, src io.Reader) error
	Dial(network, addr string) (net.Conn, error)
	Close() error
}

Directories

Path Synopsis
rpc

Jump to

Keyboard shortcuts

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