server

package
v0.0.0-...-d272c5d Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client []*ClientConnection

type ClientConnection

type ClientConnection struct {
	Conn          io.WriteCloser
	RemoteAddr    string
	LastKeepAlive int64
	IsIdle        bool
}

type ClientPrivateIP

type ClientPrivateIP = string

type DiscardConn

type DiscardConn struct{}

func (DiscardConn) Close

func (DiscardConn) Close() error

func (DiscardConn) Write

func (DiscardConn) Write(p []byte) (n int, err error)

type LocalConnAddr

type LocalConnAddr = string

type Server

type Server struct {
	gnet.BuiltinEventEngine
	// contains filtered or unexported fields
}

func New

func New(logger zerolog.Logger, cfg *config.Server) (*Server, error)

func (*Server) OnBoot

func (s *Server) OnBoot(eng gnet.Engine) gnet.Action

func (*Server) OnTick

func (s *Server) OnTick() (time.Duration, gnet.Action)

func (*Server) OnTraffic

func (s *Server) OnTraffic(conn gnet.Conn) gnet.Action

func (*Server) Run

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

Jump to

Keyboard shortcuts

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