Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DynamicReceiver ¶
type DynamicReceiver struct {
// contains filtered or unexported fields
}
DynamicReceiver 策略分包器
func NewDynamicReceiver ¶
func NewDynamicReceiver(receivers []netInterface.IReceiver, size int, onReceive func(data []byte)) *DynamicReceiver
NewDynamicReceiver 实例化策略分包器
func (*DynamicReceiver) Receiver ¶
func (d *DynamicReceiver) Receiver(conn netInterface.IConnection, buffer []byte) (err error)
Receiver 分包处理
type JT1078Receiver ¶ added in v1.5.5
type JT1078Receiver struct {
// contains filtered or unexported fields
}
JT1078Receiver JT1078分包器
func NewJT1078Receiver ¶ added in v1.5.5
func NewJT1078Receiver(startBf []byte) *JT1078Receiver
NewJT1078Receiver 按照开始结束符来粘包
func (*JT1078Receiver) CanHandle ¶ added in v1.5.6
func (j *JT1078Receiver) CanHandle(conn netInterface.IConnection, buffer []byte) bool
CanHandle 是否我处理
func (*JT1078Receiver) GetHeadLen ¶ added in v1.5.6
func (j *JT1078Receiver) GetHeadLen() int
GetHeadLen 包头必须要够长度
func (*JT1078Receiver) Receiver ¶ added in v1.5.5
func (j *JT1078Receiver) Receiver(conn netInterface.IConnection, buffer []byte) ([]byte, int)
Receiver 分包逻辑
type SpliceSymbolReceiver ¶
type SpliceSymbolReceiver struct {
// contains filtered or unexported fields
}
SpliceSymbolReceiver 按照开始结束符来粘包(单字节版)
func NewSpliceSymbolReceiver ¶
func NewSpliceSymbolReceiver(startSymbol byte, finishSymbol byte) *SpliceSymbolReceiver
NewSpliceSymbolReceiver 按照开始结束符来粘包
func (*SpliceSymbolReceiver) CanHandle ¶ added in v1.5.6
func (s *SpliceSymbolReceiver) CanHandle(conn netInterface.IConnection, buffer []byte) bool
CanHandle 是否能处理
func (*SpliceSymbolReceiver) GetHeadLen ¶ added in v1.5.6
func (s *SpliceSymbolReceiver) GetHeadLen() int
GetHeadLen 包头必须要的长度
func (*SpliceSymbolReceiver) Receiver ¶
func (s *SpliceSymbolReceiver) Receiver(conn netInterface.IConnection, buffer []byte) ([]byte, int)
Receiver 分包逻辑
Click to show internal directories.
Click to hide internal directories.