Documentation ¶
Index ¶
- type Client
- type TcpPack
- type TcpPackType
- type TcpService
- func (tcpService *TcpService) Close(clientId string)
- func (tcpService *TcpService) GetClientIp(clientId string) string
- func (tcpService *TcpService) GetConnNum() int
- func (tcpService *TcpService) GetNetMemPool() bytespool.IBytesMemPool
- func (tcpService *TcpService) NewClient(conn network.Conn) network.Agent
- func (tcpService *TcpService) OnInit() error
- func (tcpService *TcpService) ReleaseNetMem(byteBuff []byte)
- func (tcpService *TcpService) SendMsg(clientId string, msg interface{}) error
- func (tcpService *TcpService) SendRawData(clientId string, data []byte) error
- func (tcpService *TcpService) SendRawMsg(clientId string, msg []byte) error
- func (tcpService *TcpService) SetNetMemPool(memPool bytespool.IBytesMemPool)
- func (tcpService *TcpService) SetProcessor(process processor.IProcessor, handler event.IEventHandler)
- func (tcpService *TcpService) TcpEventHandler(ev event.IEvent)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 ¶
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)
Click to show internal directories.
Click to hide internal directories.