Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { sync.Mutex Addr string ConnNum int ConnectInterval time.Duration PendingWriteNum int AutoReconnect bool NewAgent func(*Conn) network.Agent Parser IParser // contains filtered or unexported fields }
type Conn ¶
func (*Conn) RemoteAddr ¶
type DefaultBinaryParser ¶
type DefaultBinaryParser struct {
// contains filtered or unexported fields
}
一个默认的二进制解析器,即leaf自带的实现 -------------- | len | data | --------------
func NewDefaultParser ¶
func NewDefaultParser() *DefaultBinaryParser
func (*DefaultBinaryParser) Read ¶
func (p *DefaultBinaryParser) Read(conn *Conn) ([]byte, error)
goroutine safe
func (*DefaultBinaryParser) SetByteOrder ¶
func (p *DefaultBinaryParser) SetByteOrder(littleEndian bool)
It's dangerous to call the method on reading or writing
Click to show internal directories.
Click to hide internal directories.