protocol

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxUDPPacketSize = 1024 * 4
	UDPTimeout       = time.Second * 5
	TCPTimeout       = time.Second * 5
)

Variables

This section is empty.

Functions

func CancelTimeout added in v0.4.2

func CancelTimeout(conn net.Conn)

func GetRandomTimeoutDuration added in v0.4.3

func GetRandomTimeoutDuration() time.Duration

func SetRandomizedTimeout added in v0.4.3

func SetRandomizedTimeout(conn net.Conn)

Types

type Command

type Command byte
const (
	Connect   Command = 1
	Bind      Command = 2
	Associate Command = 3
	Mux       Command = 0x7f
)

type ConnSession

type ConnSession interface {
	io.ReadWriteCloser
}

type HasHash added in v0.0.5

type HasHash interface {
	GetHash() string
}

type NeedAuth added in v0.0.3

type NeedAuth interface {
	SetAuth(auth stat.Authenticator)
}

type NeedConfig

type NeedConfig interface {
	SetConfig(config *conf.GlobalConfig)
}

type NeedRespond

type NeedRespond interface {
	Respond() error
}

type PacketReadWriter

type PacketReadWriter interface {
	PacketReader
	PacketWriter
}

type PacketReader

type PacketReader interface {
	ReadPacket() (req *Request, payload []byte, err error)
}

type PacketSession

type PacketSession interface {
	PacketReadWriter
	io.Closer
}

type PacketWriter

type PacketWriter interface {
	WritePacket(req *Request, payload []byte) (n int, err error)
}

type Request

type Request struct {
	Command
	*common.Address
}

func (*Request) Marshal added in v0.4.9

func (r *Request) Marshal(rr io.Reader) error

func (*Request) Network

func (r *Request) Network() string

func (*Request) String

func (r *Request) String() string

func (*Request) Unmarshal added in v0.4.9

func (r *Request) Unmarshal(w io.Writer) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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