internet

package
v1.19.1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2016 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnsupportedStreamType = errors.New("Unsupported stream type.")
)

Functions

func DialToDest added in v1.17.1

func DialToDest(src v2net.Address, dest v2net.Destination) (net.Conn, error)

Types

type Connection

type Connection interface {
	net.Conn
	Reusable
}

func Dial

func Dial(src v2net.Address, dest v2net.Destination, settings *StreamSettings) (Connection, error)

type ConnectionHandler added in v1.17.1

type ConnectionHandler func(Connection)

type Dialer

type Dialer func(src v2net.Address, dest v2net.Destination) (Connection, error)
var (
	TCPDialer    Dialer
	KCPDialer    Dialer
	RawTCPDialer Dialer
	UDPDialer    Dialer
)

type ListenFunc

type ListenFunc func(address v2net.Address, port v2net.Port) (Listener, error)
var (
	ErrClosedConnection = errors.New("Connection already closed.")

	KCPListenFunc    ListenFunc
	TCPListenFunc    ListenFunc
	RawTCPListenFunc ListenFunc
)

type Listener

type Listener interface {
	Accept() (Connection, error)
	Close() error
	Addr() net.Addr
}

type Reusable added in v1.17.1

type Reusable interface {
	Reusable() bool
	SetReusable(reuse bool)
}

type StreamConnectionType added in v1.17.1

type StreamConnectionType int
const (
	StreamConnectionTypeRawTCP StreamConnectionType = 1
	StreamConnectionTypeTCP    StreamConnectionType = 2
	StreamConnectionTypeKCP    StreamConnectionType = 4
)

type StreamSecurityType added in v1.19.1

type StreamSecurityType int
const (
	StreamSecurityTypeNone StreamSecurityType = 0
	StreamSecurityTypeTLS  StreamSecurityType = 1
)

type StreamSettings added in v1.17.1

type StreamSettings struct {
	Type        StreamConnectionType
	Security    StreamSecurityType
	TLSSettings *TLSSettings
}

func (*StreamSettings) IsCapableOf added in v1.17.1

func (this *StreamSettings) IsCapableOf(streamType StreamConnectionType) bool

type SysFd added in v1.18.1

type SysFd interface {
	SysFd() (int, error)
}

type TCPHub added in v1.17.1

type TCPHub struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func ListenTCP

func ListenTCP(address v2net.Address, port v2net.Port, callback ConnectionHandler, settings *StreamSettings) (*TCPHub, error)

func (*TCPHub) Close added in v1.17.1

func (this *TCPHub) Close()

type TLSSettings added in v1.19.1

type TLSSettings struct {
	AllowInsecure bool
	Certs         []tls.Certificate
}

func (*TLSSettings) GetTLSConfig added in v1.19.1

func (this *TLSSettings) GetTLSConfig() *tls.Config

Directories

Path Synopsis
Package kcp - A Fast and Reliable ARQ Protocol
Package kcp - A Fast and Reliable ARQ Protocol

Jump to

Keyboard shortcuts

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