transport

package
v1.2.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WND_SIZE = 32 * 1024
)

Variables

View Source
var ErrTimeout = errors.New("i/o timeout")

Functions

This section is empty.

Types

type Callback

type Callback func(op protocol.Op, upstream Transport)

type Filter

type Filter struct {
	Cmd    protocol.Command
	Remote uint64
	RPort  uint32
	Local  uint64
	LPort  uint32
}

type Handler

type Handler interface {
	Close() // Close() can be safely called multiple times
}

type Router

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

func (*Router) Check

func (self *Router) Check(fL ...Filter) (cb Callback)

func (*Router) CheckFrame

func (self *Router) CheckFrame(job protocol.Op) (cb Callback)

func (*Router) CloseHandle

func (self *Router) CloseHandle(filter Filter, el *list.Element)

func (*Router) Handle

func (self *Router) Handle(cb Callback, filters ...Filter) Handler

type Transport

type Transport interface {
	String() string
	SendTimeout(op protocol.Op, t time.Duration) error
	Send(op protocol.Op) error
	Queue(op protocol.Op)
	Handle(cb Callback, filters ...Filter) Handler
	RAddr() net.Addr
	Join()
	Close()
	Drain()
	IsClosed() bool
	OnClose(func(u Transport))
}

func Upstream

func Upstream(rw io.ReadWriter, l glog.Logger, hndl Callback, keepalive time.Duration) Transport

Jump to

Keyboard shortcuts

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