niaucchi2

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrProtocolFail = errors.New("niaucchi2: nonsensical network messages")

ErrProtocolFail means a fatal protocol violation.

View Source
var ErrTablesFull = errors.New("niaucchi2: internal tables in Context are full")

ErrTablesFull means the internal tables used in the Context are full.

View Source
var ErrTimeout = errors.New("niaucchi2: watchdog timed out")

ErrTimeout indicates a timeout error.

Functions

This section is empty.

Types

type Context

type Context struct {
	// contains filtered or unexported fields
}

Context represents a collection of secure connections used to tunnel sockets.

func NewClientCtx

func NewClientCtx() *Context

NewClientCtx creates a Context for clients.

func NewServerCtx

func NewServerCtx() *Context

NewServerCtx creates a Context for servers.

func (*Context) Absorb

func (ctx *Context) Absorb(conn net.Conn) (err error)

Absorb absorbs a new network connection into the context.

func (*Context) Accept

func (ctx *Context) Accept() (conn io.ReadWriteCloser, err error)

Accept must be called by only the server.

func (*Context) Ping

func (ctx *Context) Ping(kbs int) (rtt time.Duration, err error)

Ping measures the time it takes to RTT and receive a certain amount of data. Only one ping may be in flight at a given time!

func (*Context) Tomb

func (ctx *Context) Tomb() *tomb.Tomb

Tomb returns the tomb of the context.

func (*Context) Tunnel

func (ctx *Context) Tunnel() (conn io.ReadWriteCloser, err error)

Tunnel must be called by only the client.

Jump to

Keyboard shortcuts

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