tcpservice

package
v2.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 11 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 struct {
	// contains filtered or unexported fields
}

func (*Client) GetId

func (slf *Client) GetId() string

func (*Client) OnClose

func (slf *Client) OnClose()

func (*Client) Run

func (slf *Client) Run()

type TcpPack

type TcpPack struct {
	Type     TcpPackType //0表示连接 1表示断开 2表示数据
	ClientId string
	Data     interface{}
}

type TcpPackType

type TcpPackType int8
const (
	TPT_Connected    TcpPackType = 0
	TPT_DisConnected TcpPackType = 1
	TPT_Pack         TcpPackType = 2
	TPT_UnknownPack  TcpPackType = 3
)

type TcpService

type TcpService struct {
	service.Service
	// contains filtered or unexported fields
}

func (*TcpService) Close

func (tcpService *TcpService) Close(clientId string)

func (*TcpService) GetClientIp

func (tcpService *TcpService) GetClientIp(clientId string) string

func (*TcpService) GetConnNum

func (tcpService *TcpService) GetConnNum() int

func (*TcpService) GetNetMemPool added in v2.0.13

func (tcpService *TcpService) GetNetMemPool() bytespool.IBytesMemPool

func (*TcpService) NewClient

func (tcpService *TcpService) NewClient(conn network.Conn) network.Agent

func (*TcpService) OnInit

func (tcpService *TcpService) OnInit() error

func (*TcpService) ReleaseNetMem

func (tcpService *TcpService) ReleaseNetMem(byteBuff []byte)

func (*TcpService) SendMsg

func (tcpService *TcpService) SendMsg(clientId string, msg interface{}) error

func (*TcpService) SendRawData

func (tcpService *TcpService) SendRawData(clientId string, data []byte) error

func (*TcpService) SendRawMsg

func (tcpService *TcpService) SendRawMsg(clientId string, msg []byte) error

func (*TcpService) SetNetMemPool added in v2.0.13

func (tcpService *TcpService) SetNetMemPool(memPool bytespool.IBytesMemPool)

func (*TcpService) SetProcessor

func (tcpService *TcpService) SetProcessor(process processor.IProcessor, handler event.IEventHandler)

func (*TcpService) TcpEventHandler

func (tcpService *TcpService) TcpEventHandler(ev event.IEvent)

Jump to

Keyboard shortcuts

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