engine

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextFactoryFunc

type ContextFactoryFunc[T any] func() *T

type EngineWrapper

type EngineWrapper[T any] struct {
	gnet.BuiltinEventEngine
	Engine            gnet.Engine
	ContextFactory    ContextFactoryFunc[T]
	ExtractLength     ExtractLengthFunc[T]
	ExtractMsgID      ExtractMsgIDFunc[T]
	LastIdleReset     time.Time
	ActiveConnections int64
	MaxConnections    int64
	HeadSize          int
	ReadTimeout       int
	Handlers          map[int]handler.HandlerFunc
}

func (*EngineWrapper[T]) OnBoot

func (e *EngineWrapper[T]) OnBoot(eng gnet.Engine) gnet.Action

func (*EngineWrapper[T]) OnClose

func (e *EngineWrapper[T]) OnClose(c gnet.Conn, err error) gnet.Action

func (*EngineWrapper[T]) OnOpen

func (e *EngineWrapper[T]) OnOpen(c gnet.Conn) ([]byte, gnet.Action)

func (*EngineWrapper[T]) OnTraffic

func (e *EngineWrapper[T]) OnTraffic(c gnet.Conn) gnet.Action

type ExtractLengthFunc

type ExtractLengthFunc[T any] func(c gnet.Conn, buf []byte) (headLen int, totalLen int)

type ExtractMsgIDFunc

type ExtractMsgIDFunc[T any] func(c gnet.Conn, head []byte) (msgID int)

Jump to

Keyboard shortcuts

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