Documentation
¶
Index ¶
- Constants
- type Client
- type TcpPack
- type TcpPackType
- type TcpService
- func (slf *TcpService) Close(clientid uint64)
- func (slf *TcpService) GetClientIp(clientid uint64) string
- func (slf *TcpService) NewClient(conn *network.TCPConn) network.Agent
- func (slf *TcpService) OnInit() error
- func (slf *TcpService) SendMsg(clientid uint64, msg interface{}) error
- func (slf *TcpService) SetProcessor(process network.Processor, handler event.IEventHandler)
- func (slf *TcpService) TcpEventHandler(ev *event.Event)
Constants ¶
View Source
const Default_LittleEndian = false
View Source
const Default_MaxConnNum = 3000
View Source
const Default_MaxMsgLen = 65535
View Source
const Default_MinMsgLen = 2
View Source
const Default_PendingWriteNum = 10000
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TcpPack ¶
type TcpPack struct { Type TcpPackType //0表示连接 1表示断开 2表示数据 MsgProcessor network.Processor ClientId uint64 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 (slf *TcpService) Close(clientid uint64)
func (*TcpService) GetClientIp ¶
func (slf *TcpService) GetClientIp(clientid uint64) string
func (*TcpService) NewClient ¶
func (slf *TcpService) NewClient(conn *network.TCPConn) network.Agent
func (*TcpService) OnInit ¶
func (slf *TcpService) OnInit() error
func (*TcpService) SendMsg ¶
func (slf *TcpService) SendMsg(clientid uint64, msg interface{}) error
func (*TcpService) SetProcessor ¶
func (slf *TcpService) SetProcessor(process network.Processor, handler event.IEventHandler)
func (*TcpService) TcpEventHandler ¶
func (slf *TcpService) TcpEventHandler(ev *event.Event)
Click to show internal directories.
Click to hide internal directories.