Documentation ¶
Index ¶
- Variables
- func BuildPackData(data []byte) []byte
- func ParserPackHeader(content []byte) (l int, err error)
- type Control
- type DefaultEvHandle
- type ErrorHandle
- type EvLoopQueOp
- type IOHandle
- type ITcpHandle
- type ITcpPackRegulator
- type Option
- type PackHeader
- type TcpPackServe
- type 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
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultPackHeaderFlags = 0x169
View Source
var DefaultPackSizeMax = 0x7FF
View Source
var ErrorNonstandard = errors.New("数据包异常.")
View Source
var PackHeaderSize int
Functions ¶
func BuildPackData ¶
func ParserPackHeader ¶
ParserPackHeader 解析包头
Types ¶
type DefaultEvHandle ¶
type DefaultEvHandle struct { }
func (*DefaultEvHandle) OnAccept ¶
func (self *DefaultEvHandle) OnAccept(connId int32, conn net.Conn)
func (*DefaultEvHandle) OnClosed ¶
func (self *DefaultEvHandle) OnClosed(connId int32)
func (*DefaultEvHandle) OnError ¶
func (self *DefaultEvHandle) OnError(err error)
func (*DefaultEvHandle) OnFinish ¶
func (self *DefaultEvHandle) OnFinish(id int32)
func (*DefaultEvHandle) OnReceived ¶
func (self *DefaultEvHandle) OnReceived(connId int32, content []byte) error
type ErrorHandle ¶
type ErrorHandle interface {
OnError(err error)
}
type EvLoopQueOp ¶
type EvLoopQueOp struct {
// contains filtered or unexported fields
}
func NewEvLoopQueOp ¶
func NewEvLoopQueOp(queSize uint32) *EvLoopQueOp
func (EvLoopQueOp) GetValue ¶
func (self EvLoopQueOp) GetValue() interface{}
type ITcpHandle ¶
type ITcpPackRegulator ¶
type PackHeader ¶
type PackHeader struct {
Flag int32
}
type TcpPackServe ¶
type TcpPackServe struct { *TcpServe // contains filtered or unexported fields }
func NewTcpPackServe ¶
func NewTcpPackServe(tcp *TcpServe, hSize int, regulator ITcpPackRegulator) *TcpPackServe
func (*TcpPackServe) SendData ¶
func (self *TcpPackServe) SendData(connId int32, data []byte)
func (*TcpPackServe) SyncSendData ¶
func (self *TcpPackServe) SyncSendData(connId int32, data []byte) bool
type TcpServe ¶
type TcpServe struct { gevent.DefaultEventReactor IOHandle // contains filtered or unexported fields }
func NewTcpServe ¶
func (*TcpServe) IsExistConnId ¶
func (*TcpServe) OnCmdHandle ¶
func (*TcpServe) OnFinishEventLoop ¶
func (*TcpServe) StopAndWait ¶
func (self *TcpServe) StopAndWait()
Click to show internal directories.
Click to hide internal directories.