udp

package
v2.4.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2016 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadUDPMsg added in v1.24.4

func ReadUDPMsg(conn *net.UDPConn, payload []byte, oob []byte) (int, int, int, *net.UDPAddr, error)

func RetrieveOriginalDest added in v1.24.3

func RetrieveOriginalDest(oob []byte) v2net.Destination

func SetOriginalDestOptions added in v1.24.3

func SetOriginalDestOptions(fd int) error

Types

type Connection

type Connection struct {
	net.UDPConn
}

func (*Connection) Reusable

func (this *Connection) Reusable() bool

func (*Connection) SetReusable

func (this *Connection) SetReusable(b bool)

type ListenOption added in v1.24.3

type ListenOption struct {
	Callback            UDPPayloadHandler
	ReceiveOriginalDest bool
}

type TimedInboundRay

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

func NewTimedInboundRay

func NewTimedInboundRay(name string, inboundRay ray.InboundRay, server *UDPServer) *TimedInboundRay

func (*TimedInboundRay) InboundInput

func (this *TimedInboundRay) InboundInput() ray.OutputStream

func (*TimedInboundRay) InboundOutput

func (this *TimedInboundRay) InboundOutput() ray.InputStream

func (*TimedInboundRay) Monitor

func (this *TimedInboundRay) Monitor()

func (*TimedInboundRay) Release

func (this *TimedInboundRay) Release()

type UDPHub

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

func ListenUDP

func ListenUDP(address v2net.Address, port v2net.Port, option ListenOption) (*UDPHub, error)

func (*UDPHub) Addr added in v1.24.3

func (this *UDPHub) Addr() net.Addr

func (*UDPHub) Close

func (this *UDPHub) Close()

func (*UDPHub) Connection added in v1.24.3

func (this *UDPHub) Connection() net.Conn

Connection return the net.Conn underneath this hub. Private: Visible for testing only

func (*UDPHub) Running added in v1.21.2

func (this *UDPHub) Running() bool

func (*UDPHub) WriteTo

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

type UDPPayloadHandler

type UDPPayloadHandler func(*alloc.Buffer, *proxy.SessionInfo)

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(meta *proxy.InboundHandlerMeta, packetDispatcher dispatcher.PacketDispatcher) *UDPServer

func (*UDPServer) Dispatch

func (this *UDPServer) Dispatch(session *proxy.SessionInfo, payload *alloc.Buffer, callback UDPResponseCallback)

func (*UDPServer) RemoveRay

func (this *UDPServer) RemoveRay(name string)

Jump to

Keyboard shortcuts

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