Documentation ¶
Index ¶
- func CRC32Hash(s string) uint32
- func CheckArgs1MsgFun(cb interface{}) (err error, funValue reflect.Value, msgType reflect.Type)
- func IsExists(path string) bool
- func ProtoHash(msg proto.Message) (uint32, reflect.Type)
- func StringHash(s string) (hash uint16)
- type Client
- type Config
- type Conn
- type Mgr
- func (p *Mgr) Close()
- func (p *Mgr) GetSession(sesID int32) (Session, bool)
- func (p *Mgr) ListenAddr() *net.TCPAddr
- func (p *Mgr) Post(f func())
- func (p *Mgr) RegisterEvent(onNew, onClose func(conn Session))
- func (p *Mgr) RegisterRawSessionMsgHandler(msg proto.Message, handler MsgHandler)
- func (p *Mgr) RegisterSessionMsgHandler(cb interface{})
- func (p *Mgr) Run()
- type MsgHandler
- type MsgInfo
- type Processor
- func (p *Processor) Encode(msgID uint32, data []byte) []byte
- func (p *Processor) Handle(msg proto.Message, client Session) error
- func (p *Processor) Marshal(msg proto.Message) ([]byte, error)
- func (p *Processor) RegisterSessionMsgHandler(msg proto.Message, handler MsgHandler)
- func (p *Processor) SetByteOrder(littleEndian bool)
- func (p *Processor) Unmarshal(data []byte) (proto.Message, error)
- type Session
- type Work
- func (p *Work) AfterPost(d time.Duration, f func()) *time.Timer
- func (p *Work) Close()
- func (p *Work) Len() int
- func (p *Work) NewTicker(d time.Duration, f func()) io.Closer
- func (p *Work) NewTryTicker(d time.Duration, maxLen int, f func()) *time.Ticker
- func (p *Work) Post(f func())
- func (p *Work) Run()
- func (p *Work) TryPost(f func(), maxLen int)
- type Worker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckArgs1MsgFun ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) SendRawMsg ¶
type Mgr ¶
type Mgr struct {
// contains filtered or unexported fields
}
func (*Mgr) ListenAddr ¶
func (*Mgr) RegisterEvent ¶
func (*Mgr) RegisterRawSessionMsgHandler ¶
func (p *Mgr) RegisterRawSessionMsgHandler(msg proto.Message, handler MsgHandler)
func (*Mgr) RegisterSessionMsgHandler ¶
func (p *Mgr) RegisterSessionMsgHandler(cb interface{})
type MsgHandler ¶
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
func NewProcessor ¶
func NewProcessor() *Processor
func (*Processor) RegisterSessionMsgHandler ¶
func (p *Processor) RegisterSessionMsgHandler(msg proto.Message, handler MsgHandler)
func (*Processor) SetByteOrder ¶
type Work ¶
type Work struct {
// contains filtered or unexported fields
}
func (*Work) NewTryTicker ¶
worker长度超过maxLen就丢弃f
Click to show internal directories.
Click to hide internal directories.