udp

package
v3.50.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2018 License: MIT Imports: 16 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.2

func RetrieveOriginalDest(oob []byte) net.Destination

Types

type Config

type Config struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Config) Descriptor

func (*Config) Descriptor() ([]byte, []int)

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) Reset

func (m *Config) Reset()

func (*Config) String

func (m *Config) String() string

func (*Config) XXX_DiscardUnknown

func (m *Config) XXX_DiscardUnknown()

func (*Config) XXX_Marshal

func (m *Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Config) XXX_Merge

func (m *Config) XXX_Merge(src proto.Message)

func (*Config) XXX_Size

func (m *Config) XXX_Size() int

func (*Config) XXX_Unmarshal

func (m *Config) XXX_Unmarshal(b []byte) error

type Dispatcher

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

func NewDispatcher

func NewDispatcher(dispatcher routing.Dispatcher, callback ResponseCallback) *Dispatcher

func (*Dispatcher) Dispatch

func (v *Dispatcher) Dispatch(ctx context.Context, destination net.Destination, payload *buf.Buffer)

func (*Dispatcher) RemoveRay

func (v *Dispatcher) RemoveRay(dest net.Destination)

type Hub

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

func ListenUDP

func ListenUDP(ctx context.Context, address net.Address, port net.Port, options ...HubOption) (*Hub, error)

func (*Hub) Addr

func (h *Hub) Addr() net.Addr

Addr implements net.Listener.

func (*Hub) Close

func (h *Hub) Close() error

Close implements net.Listener.

func (*Hub) Receive

func (h *Hub) Receive() <-chan *Payload

func (*Hub) WriteTo

func (h *Hub) WriteTo(payload []byte, dest net.Destination) (int, error)

type HubOption

type HubOption func(h *Hub)

func HubCapacity

func HubCapacity(capacity int) HubOption

func HubReceiveOriginalDestination

func HubReceiveOriginalDestination(r bool) HubOption

type Payload

type Payload struct {
	Content             *buf.Buffer
	Source              net.Destination
	OriginalDestination net.Destination
}

Payload represents a single UDP payload.

type ResponseCallback

type ResponseCallback func(ctx context.Context, payload *buf.Buffer)

Jump to

Keyboard shortcuts

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