fastudp

package module
v0.0.0-...-b1c78d7 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: MIT Imports: 10 Imported by: 0

README

fastudp

fast and more fast

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MsgHdrSize     = 128
	ReadEventSize  = 128
	WriteEventSize = 128
)

Functions

This section is empty.

Types

type EventHandler

type EventHandler interface {
	OnReaded([]byte, *net.UDPAddr)
	OnError(err error)
}

type Server

type Server struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewUDPServer

func NewUDPServer(network, addr string, reusePort bool, listenerN int, mtu int, handler EventHandler) (*Server, error)

func (*Server) Shutdown

func (svr *Server) Shutdown()

func (*Server) WriteTo

func (svr *Server) WriteTo(addr *net.UDPAddr, data []byte) (int, error)

TODO: need load balancing?

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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