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

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

type ConnectionHandler func(Connection)

type TCPConnection

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

func (*TCPConnection) Close

func (this *TCPConnection) Close() error

func (*TCPConnection) CloseRead

func (this *TCPConnection) CloseRead() error

func (*TCPConnection) CloseWrite

func (this *TCPConnection) CloseWrite() error

func (*TCPConnection) LocalAddr

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

func (*TCPConnection) Read

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

func (*TCPConnection) Release

func (this *TCPConnection) Release()

func (*TCPConnection) RemoteAddr

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

func (*TCPConnection) SetDeadline

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

func (*TCPConnection) SetReadDeadline

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

func (*TCPConnection) SetWriteDeadline

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

func (*TCPConnection) Write

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

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

func (*TLSConnection) Close

func (this *TLSConnection) Close() error

func (*TLSConnection) CloseRead

func (this *TLSConnection) CloseRead() error

func (*TLSConnection) CloseWrite

func (this *TLSConnection) CloseWrite() error

func (*TLSConnection) LocalAddr

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

func (*TLSConnection) Read

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

func (*TLSConnection) Release

func (this *TLSConnection) Release()

func (*TLSConnection) RemoteAddr

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

func (*TLSConnection) SetDeadline

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

func (*TLSConnection) SetReadDeadline

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

func (*TLSConnection) SetWriteDeadline

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

func (*TLSConnection) Write

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