server

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IServer

type IServer interface {
	Init() bool
	MainLoop()
	Reload()
	Final() bool
}

type ITcpTask

type ITcpTask interface {
	ParseMsg(data []byte)
	OnClose()
}

type Server

type Server struct {
	Derived IServer
	// contains filtered or unexported fields
}

func (*Server) Close

func (s *Server) Close()

func (*Server) IsClosed

func (s *Server) IsClosed() bool

func (*Server) Main

func (s *Server) Main() bool

func (*Server) SetCPUNum

func (s *Server) SetCPUNum(num int)

type TCPClient

type TCPClient struct {
}

func (*TCPClient) Connect

func (this *TCPClient) Connect(address string) (*net.TCPConn, error)

type TCPGHandler

type TCPGHandler func(ctx context.Context, conn *net.TCPConn)

type TCPServer

type TCPServer interface {
	BindAccept(ctx context.Context, address string, handler TCPGHandler) error
}

func NewTCPServer

func NewTCPServer(ctx context.Context, address string, handler TCPGHandler) (TCPServer, error)

type TCPTask

type TCPTask struct {
	Conn    net.Conn
	Derived ITcpTask
	// contains filtered or unexported fields
}

func NewTCPTask

func NewTCPTask(conn net.Conn) *TCPTask

func (*TCPTask) Close

func (tt *TCPTask) Close()

func (*TCPTask) IsClosed

func (tt *TCPTask) IsClosed() bool

func (*TCPTask) IsVerified

func (tt *TCPTask) IsVerified() bool

func (*TCPTask) LocalAddr

func (tt *TCPTask) LocalAddr() string

func (*TCPTask) RecvLoop

func (tt *TCPTask) RecvLoop()

func (*TCPTask) RemoteAddr

func (tt *TCPTask) RemoteAddr() string

func (*TCPTask) Reset

func (tt *TCPTask) Reset() bool

func (*TCPTask) SendBytes

func (tt *TCPTask) SendBytes(buffer []byte) bool

func (*TCPTask) SendLoop

func (tt *TCPTask) SendLoop(job *sync.WaitGroup)

func (*TCPTask) SendSignal

func (tt *TCPTask) SendSignal()

func (*TCPTask) Start

func (tt *TCPTask) Start()

func (*TCPTask) Stop

func (tt *TCPTask) Stop() bool

func (*TCPTask) Terminate

func (tt *TCPTask) Terminate()

func (*TCPTask) Verify

func (tt *TCPTask) Verify()

Jump to

Keyboard shortcuts

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