kcp

package
v0.0.0-...-e0c7852 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	Key:          "",
	Crypt:        "aes",
	MTU:          1350,
	SndWnd:       128,
	RcvWnd:       512,
	DataShard:    10,
	ParityShard:  3,
	DSCP:         0,
	AckNodelay:   false,
	NoDelay:      0,
	Interval:     30,
	Resend:       2,
	NoCongestion: 1,
	SockBuf:      4194304,
}
View Source
var (
	ErrInvalidKey = errors.New("kcp: crypt key not set")
)

Functions

func Dial

func Dial(addr string, conf *Config) (net.Conn, error)

func Listen

func Listen(addr string, conf *Config) (net.Listener, error)

Types

type Config

type Config struct {
	Key          string `json:"key"`
	Crypt        string `json:"crypt"`
	MTU          int    `json:"mtu"`
	SndWnd       int    `json:"sndwnd"`
	RcvWnd       int    `json:"rcvwnd"`
	DataShard    int    `json:"datashard"`
	ParityShard  int    `json:"parityshard"`
	DSCP         int    `json:"dscp"`
	AckNodelay   bool   `json:"acknodelay"`
	NoDelay      int    `json:"nodelay"`
	Interval     int    `json:"interval"`
	Resend       int    `json:"resend"`
	NoCongestion int    `json:"nc"`
	SockBuf      int    `json:"sockbuf"`
}

Jump to

Keyboard shortcuts

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