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 (server *TcpService) GetNetMempool() bytespool.IBytesMempool
- func (tcpService *TcpService) NewClient(conn *network.TCPConn) network.Agent
- func (tcpService *TcpService) OnInit() error
- func (server *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 (server *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 ¶
func (server *TcpService) GetNetMempool() bytespool.IBytesMempool
func (*TcpService) NewClient ¶
func (tcpService *TcpService) NewClient(conn *network.TCPConn) network.Agent
func (*TcpService) OnInit ¶
func (tcpService *TcpService) OnInit() error
func (*TcpService) ReleaseNetMem ¶
func (server *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 ¶
func (server *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.