Versions in this module Expand all Collapse all v0 v0.0.1 Feb 26, 2020 Changes in this version + var DefaultPackHeaderFlags = 0x169 + var DefaultPackSizeMax = 0x7FF + var ErrorNonstandard = errors.New("数据包异常.") + var PackHeaderSize int + func BuildPackData(data []byte) []byte + func ParserPackHeader(content []byte) (l int, err error) + type Control interface + Launch func() int32 + Run func() + StopAndWait func() + type DefaultEvHandle struct + func (self *DefaultEvHandle) OnAccept(connId int32, conn net.Conn) + func (self *DefaultEvHandle) OnClosed(connId int32) + func (self *DefaultEvHandle) OnError(err error) + func (self *DefaultEvHandle) OnFinish(id int32) + func (self *DefaultEvHandle) OnReceived(connId int32, content []byte) error + type ErrorHandle interface + OnError func(err error) + type EvLoopQueOp struct + func NewEvLoopQueOp(queSize uint32) *EvLoopQueOp + func (self EvLoopQueOp) GetValue() interface{} + type IOHandle interface + type ITcpHandle interface + OnAccept func(connId int32, conn net.Conn) + OnClosed func(connId int32) + OnFinish func(id int32) + OnReceived func(connId int32, content []byte) error + type ITcpPackRegulator interface + BuildPackData func(data []byte) []byte + ParserPackHeader func(content []byte) (l int, err error) + type Option interface + GetValue func() interface{} + type PackHeader struct + Flag int32 + type TcpPackServe struct + func NewTcpPackServe(tcp *TcpServe, hSize int, regulator ITcpPackRegulator) *TcpPackServe + func (self *TcpPackServe) SendData(connId int32, data []byte) + func (self *TcpPackServe) SyncSendData(connId int32, data []byte) bool + type TcpServe struct + func NewTcpServe(cxt context.Context, listener net.Listener, cb ITcpHandle, options ...Option) *TcpServe + func (self *TcpServe) CloseConn(connId int32) + func (self *TcpServe) IsExistConnId(connId int32) bool + func (self *TcpServe) Launch() int32 + func (self *TcpServe) OnCmdHandle(id int32, evCmd int64, extras []interface{}) + func (self *TcpServe) OnFinishEventLoop(id int32) + func (self *TcpServe) Run() + func (self *TcpServe) SendData(connId int32, data []byte) + func (self *TcpServe) StopAndWait() + func (self *TcpServe) SyncSendData(connId int32, data []byte) bool