transport

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KCP

type KCP struct {
	DataShards     int
	ParityShards   int
	SendWindowSize int
	RecvWindowSize int
}

KCP represents the KCP transport protocol alongside its respective configurable options.

func NewKCP

func NewKCP() *KCP

NewKCP instantiates a new instance of the KCP transport protocol.

func (*KCP) Dial

func (t *KCP) Dial(address string) (net.Conn, error)

Dial dials an address via. the KCP protocol, with optional Reed-Solomon message sharding and send/receive window size configurations.

func (*KCP) Listen

func (t *KCP) Listen(port int) (net.Listener, error)

Listen listens for incoming KCP connections on a specified port, with optional Reed-Solomon message sharding.

type Layer

type Layer interface {
	Listen(port int) (net.Listener, error)
	Dial(address string) (net.Conn, error)
}

type TCP

type TCP struct {
	WriteBufferSize int
	ReadBufferSize  int
	NoDelay         bool
}

func NewTCP

func NewTCP() *TCP

func (*TCP) Dial

func (t *TCP) Dial(address string) (net.Conn, error)

func (*TCP) Listen

func (t *TCP) Listen(port int) (net.Listener, error)

Jump to

Keyboard shortcuts

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