udp

package
v3.0.16 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrClosed = errors.New("network closed")

ErrClosed represents a error.

Functions

func RegisterHandler

func RegisterHandler()

func RegisterTransport

func RegisterTransport()

Types

type Handler

type Handler struct {
	Service *core.Service
	Pool    core.WorkerPool
	OnClose func(net.Conn)
	OnError func(net.Conn, error)
}

func (*Handler) BindContext

func (h *Handler) BindContext(ctx context.Context, server core.Server)

BindContext to the http server.

func (*Handler) Serve

func (h *Handler) Serve(ctx context.Context, conn *net.UDPConn)

type Transport

type Transport struct {
	OnConnect func(net.Conn) net.Conn
	OnClose   func(net.Conn)
	// contains filtered or unexported fields
}

func (*Transport) Abort

func (trans *Transport) Abort()

func (*Transport) Transport

func (trans *Transport) Transport(ctx context.Context, request []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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