gudp

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2025 License: MIT Imports: 3 Imported by: 0

README

UDP

server/gudp 中基于 G 包 UDP 组件实现了 Server,用以注册 udp 到 dove.Server() 中。

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	*gudp.Server
	// contains filtered or unexported fields
}

Server 定义 UDP 服务器。

func NewServer

func NewServer(opts ...ServerOption) *Server

NewServer 新建 UDP 服务器。

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Start 启动 UDP 服务器。

func (*Server) Stop

func (s *Server) Stop(ctx context.Context) error

Stop 停止 UDP 服务器。

type ServerOption

type ServerOption func(s *Server)

ServerOption 定义一个 UDP 服务选项类型。

func Address

func Address(address string) ServerOption

Address 配置服务监听地址。

func Handler

func Handler(handler func(*gudp.Conn)) ServerOption

Handler 配置处理器。

Jump to

Keyboard shortcuts

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