transport

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 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")
	ErrKeepAliveNeeded = errors.New("keep alive needed")
	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 DisableIPv6

func DisableIPv6()

func SetBufferSize

func SetBufferSize(size uint16)

func SetNetwork

func SetNetwork(network string)

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