Receivers

package
v1.8.24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

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), errorCallback func(errStr string)) *DynamicReceiver

NewDynamicReceiver 实例化策略分包器

func (*DynamicReceiver) Receiver

func (d *DynamicReceiver) Receiver(conn netInterface.IConnection, buffer []byte) (err error)

Receiver 分包处理

func (*DynamicReceiver) Recovery added in v1.8.17

func (d *DynamicReceiver) Recovery(conn netInterface.IConnection)

Recovery 回收资源

type EmptyReceiver added in v1.8.15

type EmptyReceiver struct {
}

func (*EmptyReceiver) CanHandle added in v1.8.15

func (s *EmptyReceiver) CanHandle(conn netInterface.IConnection, buffer []byte) bool

CanHandle 是否能处理

func (*EmptyReceiver) GetHeadLen added in v1.8.15

func (s *EmptyReceiver) GetHeadLen() int

GetHeadLen 包头必须要的长度

func (*EmptyReceiver) Receiver added in v1.8.15

func (s *EmptyReceiver) Receiver(conn netInterface.IConnection, buffer []byte) ([]byte, int)

func (*EmptyReceiver) Reset added in v1.8.15

func (s *EmptyReceiver) Reset()

Reset 重置分包状态为初始状态

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 分包逻辑

func (*JT1078Receiver) Reset added in v1.8.11

func (j *JT1078Receiver) Reset()

Reset 重置分包状态为初始状态

type SpliceStartAndDataLengthHexReceiver added in v1.8.17

type SpliceStartAndDataLengthHexReceiver struct {
	// contains filtered or unexported fields
}

SpliceStartAndDataLengthHexReceiver 开始加数据长度分包算法

func NewSpliceStartAndDataLengthHexReceiver added in v1.8.17

func NewSpliceStartAndDataLengthHexReceiver(startSymbol []byte, appendCount int, dataLengthIndex int, dataLengthCount int) *SpliceStartAndDataLengthHexReceiver

NewSpliceStartAndDataLengthHexReceiver 开始加数据长度分包算法

func (*SpliceStartAndDataLengthHexReceiver) CanHandle added in v1.8.17

CanHandle 是否能处理

func (*SpliceStartAndDataLengthHexReceiver) GetHeadLen added in v1.8.17

func (s *SpliceStartAndDataLengthHexReceiver) GetHeadLen() int

GetHeadLen 包头必须要的长度

func (*SpliceStartAndDataLengthHexReceiver) Receiver added in v1.8.17

func (s *SpliceStartAndDataLengthHexReceiver) Receiver(conn netInterface.IConnection, buffer []byte) ([]byte, int)

Receiver 分包处理

func (*SpliceStartAndDataLengthHexReceiver) Reset added in v1.8.17

Reset 重置分包状态为初始状态

type SpliceStartAndDataLengthReceiver added in v1.8.17

type SpliceStartAndDataLengthReceiver struct {
	// contains filtered or unexported fields
}

SpliceStartAndDataLengthReceiver 开始加数据长度分包算法

func NewSpliceStartAndDataLengthReceiver added in v1.8.17

func NewSpliceStartAndDataLengthReceiver(startSymbol []byte, appendCount int, dataLengthIndex int, dataLengthCount int) *SpliceStartAndDataLengthReceiver

NewSpliceStartAndDataLengthReceiver 开始加数据长度分包算法

func (*SpliceStartAndDataLengthReceiver) CanHandle added in v1.8.17

func (s *SpliceStartAndDataLengthReceiver) CanHandle(conn netInterface.IConnection, buffer []byte) bool

CanHandle 是否能处理

func (*SpliceStartAndDataLengthReceiver) GetHeadLen added in v1.8.17

func (s *SpliceStartAndDataLengthReceiver) GetHeadLen() int

GetHeadLen 包头必须要的长度

func (*SpliceStartAndDataLengthReceiver) Receiver added in v1.8.17

func (s *SpliceStartAndDataLengthReceiver) Receiver(conn netInterface.IConnection, buffer []byte) ([]byte, int)

Receiver 分包处理

func (*SpliceStartAndDataLengthReceiver) Reset added in v1.8.17

Reset 重置分包状态为初始状态

type SpliceStartAndLengthReceiver added in v1.8.17

type SpliceStartAndLengthReceiver struct {
	// contains filtered or unexported fields
}

SpliceStartAndLengthReceiver 开始加长度分包

func NewSpliceStartAndLengthReceiver added in v1.8.17

func NewSpliceStartAndLengthReceiver(symbol byte, length int) *SpliceStartAndLengthReceiver

NewSpliceStartAndLengthReceiver 开始加长度分包

func (*SpliceStartAndLengthReceiver) CanHandle added in v1.8.17

func (s *SpliceStartAndLengthReceiver) CanHandle(conn netInterface.IConnection, buffer []byte) bool

CanHandle 是否能处理

func (*SpliceStartAndLengthReceiver) GetHeadLen added in v1.8.17

func (s *SpliceStartAndLengthReceiver) GetHeadLen() int

GetHeadLen 包头必须要的长度

func (*SpliceStartAndLengthReceiver) Receiver added in v1.8.17

func (s *SpliceStartAndLengthReceiver) Receiver(conn netInterface.IConnection, buffer []byte) ([]byte, int)

Receiver 分包处理

func (*SpliceStartAndLengthReceiver) Reset added in v1.8.17

func (s *SpliceStartAndLengthReceiver) Reset()

Reset 重置分包状态为初始状态

type SpliceStartFinishManyReceiver added in v1.8.17

type SpliceStartFinishManyReceiver struct {
	// contains filtered or unexported fields
}

SpliceStartFinishManyReceiver 开始结束分包器,多字节【jt808适用】

func NewSpliceStartFinishManyReceiver added in v1.8.17

func NewSpliceStartFinishManyReceiver(startSymbol []byte, finishSymbol []byte) *SpliceStartFinishManyReceiver

NewSpliceStartFinishManyReceiver 按照开始结束符来粘包

func (*SpliceStartFinishManyReceiver) CanHandle added in v1.8.17

func (s *SpliceStartFinishManyReceiver) CanHandle(conn netInterface.IConnection, buffer []byte) bool

CanHandle 是否能处理

func (*SpliceStartFinishManyReceiver) GetHeadLen added in v1.8.17

func (s *SpliceStartFinishManyReceiver) GetHeadLen() int

GetHeadLen 包头必须要的长度

func (*SpliceStartFinishManyReceiver) Receiver added in v1.8.17

func (s *SpliceStartFinishManyReceiver) Receiver(conn netInterface.IConnection, buffer []byte) ([]byte, int)

Receiver 分包处理

func (*SpliceStartFinishManyReceiver) Reset added in v1.8.17

func (s *SpliceStartFinishManyReceiver) Reset()

Reset 重置分包状态为初始状态

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 分包逻辑

func (*SpliceSymbolReceiver) Reset added in v1.8.11

func (s *SpliceSymbolReceiver) Reset()

Reset 重置分包状态为初始状态

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL