hub

package
v1.12.3 Latest Latest
Warning

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

Go to latest
Published: May 2, 2016 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorClosedConnection = errors.New("Connection already closed.")
)

Functions

This section is empty.

Types

type Connection added in v1.12.1

type Connection interface {
	common.Releasable

	Read([]byte) (int, error)
	Write([]byte) (int, error)
	Close() error
	LocalAddr() net.Addr
	RemoteAddr() net.Addr
	SetDeadline(t time.Time) error
	SetReadDeadline(t time.Time) error
	SetWriteDeadline(t time.Time) error
	CloseRead() error
	CloseWrite() error
}

type ConnectionHandler added in v1.12.1

type ConnectionHandler func(Connection)

type TCPConnection added in v1.12.1

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

func (*TCPConnection) Close added in v1.12.1

func (this *TCPConnection) Close() error

func (*TCPConnection) CloseRead added in v1.12.1

func (this *TCPConnection) CloseRead() error

func (*TCPConnection) CloseWrite added in v1.12.1

func (this *TCPConnection) CloseWrite() error

func (*TCPConnection) LocalAddr added in v1.12.1

func (this *TCPConnection) LocalAddr() net.Addr

func (*TCPConnection) Read added in v1.12.1

func (this *TCPConnection) Read(b []byte) (int, error)

func (*TCPConnection) Release added in v1.12.1

func (this *TCPConnection) Release()

func (*TCPConnection) RemoteAddr added in v1.12.1

func (this *TCPConnection) RemoteAddr() net.Addr

func (*TCPConnection) SetDeadline added in v1.12.1

func (this *TCPConnection) SetDeadline(t time.Time) error

func (*TCPConnection) SetReadDeadline added in v1.12.1

func (this *TCPConnection) SetReadDeadline(t time.Time) error

func (*TCPConnection) SetWriteDeadline added in v1.12.1

func (this *TCPConnection) SetWriteDeadline(t time.Time) error

func (*TCPConnection) Write added in v1.12.1

func (this *TCPConnection) Write(b []byte) (int, error)

type TCPHub

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

func ListenTCP

func ListenTCP(port v2net.Port, callback ConnectionHandler) (*TCPHub, error)

func (*TCPHub) Close

func (this *TCPHub) Close()

type TLSConnection added in v1.12.1

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

func (*TLSConnection) Close added in v1.12.1

func (this *TLSConnection) Close() error

func (*TLSConnection) CloseRead added in v1.12.1

func (this *TLSConnection) CloseRead() error

func (*TLSConnection) CloseWrite added in v1.12.1

func (this *TLSConnection) CloseWrite() error

func (*TLSConnection) LocalAddr added in v1.12.1

func (this *TLSConnection) LocalAddr() net.Addr

func (*TLSConnection) Read added in v1.12.1

func (this *TLSConnection) Read(b []byte) (int, error)

func (*TLSConnection) Release added in v1.12.1

func (this *TLSConnection) Release()

func (*TLSConnection) RemoteAddr added in v1.12.1

func (this *TLSConnection) RemoteAddr() net.Addr

func (*TLSConnection) SetDeadline added in v1.12.1

func (this *TLSConnection) SetDeadline(t time.Time) error

func (*TLSConnection) SetReadDeadline added in v1.12.1

func (this *TLSConnection) SetReadDeadline(t time.Time) error

func (*TLSConnection) SetWriteDeadline added in v1.12.1

func (this *TLSConnection) SetWriteDeadline(t time.Time) error

func (*TLSConnection) Write added in v1.12.1

func (this *TLSConnection) Write(b []byte) (int, error)

type UDPHub

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

func ListenUDP

func ListenUDP(port v2net.Port, callback UDPPayloadHandler) (*UDPHub, error)

func (*UDPHub) Close

func (this *UDPHub) Close()

func (*UDPHub) WriteTo

func (this *UDPHub) WriteTo(payload []byte, dest v2net.Destination) (int, error)

type UDPPayloadHandler

type UDPPayloadHandler func(*alloc.Buffer, v2net.Destination)

type UDPResponseCallback

type UDPResponseCallback func(destination v2net.Destination, payload *alloc.Buffer)

type UDPServer

type UDPServer struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewUDPServer

func NewUDPServer(packetDispatcher dispatcher.PacketDispatcher) *UDPServer

func (*UDPServer) Dispatch

func (this *UDPServer) Dispatch(source v2net.Destination, destination v2net.Destination, payload *alloc.Buffer, callback UDPResponseCallback)

Jump to

Keyboard shortcuts

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