gnet

package module
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrConnectionReset     = errors.New("connection reset by peer")
	ErrReadConnectionReset = errors.New("read: connection reset by peer")
)
View Source
var (
	ErrIncompletePacket = errors.New("incomplete packet")
)

Functions

func NewServer

func NewServer(opts ...ServerOption) network.Server

Types

type ServerOption

type ServerOption func(o *serverOptions)

func WithServerEnableHeartbeatCheck

func WithServerEnableHeartbeatCheck(enable bool) ServerOption

WithServerEnableHeartbeatCheck 是否启用心跳检测

func WithServerHeartbeatInterval

func WithServerHeartbeatInterval(heartbeatInterval time.Duration) ServerOption

WithServerHeartbeatInterval 设置心跳检测间隔时间

func WithServerListenAddr

func WithServerListenAddr(addr string) ServerOption

WithServerListenAddr 设置监听地址

func WithServerMaxMsgLen

func WithServerMaxMsgLen(maxMsgLen int) ServerOption

WithServerMaxMsgLen 设置消息最大长度

func WithServerMulticore

func WithServerMulticore(multicore bool) ServerOption

WithServerMulticore 设置心跳检测间隔时间

Jump to

Keyboard shortcuts

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