hub

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2016 License: MIT Imports: 9 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 TCPConn

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

func (*TCPConn) Close

func (this *TCPConn) Close() error

func (*TCPConn) CloseRead

func (this *TCPConn) CloseRead() error

func (*TCPConn) CloseWrite

func (this *TCPConn) CloseWrite() error

func (*TCPConn) LocalAddr

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

func (*TCPConn) Read

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

func (*TCPConn) Release

func (this *TCPConn) Release()

func (*TCPConn) RemoteAddr

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

func (*TCPConn) SetDeadline

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

func (*TCPConn) SetReadDeadline

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

func (*TCPConn) SetWriteDeadline

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

func (*TCPConn) Write

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

type TCPHub

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

func ListenTCP

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

func (*TCPHub) Close

func (this *TCPHub) Close()

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(packet v2net.Packet)

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, packet v2net.Packet, callback UDPResponseCallback)

Jump to

Keyboard shortcuts

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