Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDynamicSpliceSymbol ¶ added in v1.1.1
func NewDynamicSpliceSymbol(startSymbol byte, finishSymbol byte) netInterface.IReceiver
实例化
Types ¶
type DynamicReceiver ¶
type DynamicReceiver struct { CurrentReceiver netInterface.IReceiver //当前分包器 Receivers []netInterface.IReceiver //分包器集合 IsPackStart bool //是否开始分包 IsSingle bool //是否只有一个分包算法 }
策略分包器
func (*DynamicReceiver) Receiver ¶
func (d *DynamicReceiver) Receiver(conn netInterface.IConnection, buffer []byte, offset int, count int) (err error)
分包处理
type DynamicSpliceSymbol ¶ added in v1.1.1
type DynamicSpliceSymbol struct { *SpliceSymbolReceiver // contains filtered or unexported fields }
单字节策略
func (*DynamicSpliceSymbol) IsMeHandle ¶ added in v1.1.1
func (d *DynamicSpliceSymbol) IsMeHandle(conn netInterface.IConnection, buffer []byte) bool
是否我处理
func (*DynamicSpliceSymbol) Receiver ¶ added in v1.1.1
func (d *DynamicSpliceSymbol) Receiver(conn netInterface.IConnection, buffer []byte) ([]byte, int, bool)
分包处理[处理一包后跳出]
type SpliceSymbolReceiver ¶
/ 按照开始结束符来粘包(单字节版)
func NewSpliceSymbolReceiver ¶
func NewSpliceSymbolReceiver(startSymbol byte, finishSymbol byte) *SpliceSymbolReceiver
按照开始结束符来粘包
func (*SpliceSymbolReceiver) Receiver ¶
func (s *SpliceSymbolReceiver) Receiver(conn netInterface.IConnection, buffer []byte) ([]byte, int, bool)
分包逻辑
Click to show internal directories.
Click to hide internal directories.