You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nnet/packet/packet.go

20 lines
475 B
Go

package packet
import "errors"
var (
// ErrWrongPacketType represents a wrong packet type.
ErrWrongPacketType = errors.New("wrong packet type")
// ErrPacketSizeExceed represents a wrong packet size.
ErrPacketSizeExceed = errors.New("packet size exceed")
)
type (
// IPacket 数据帧
IPacket interface {
GetHeader() any // 数据帧头部 Header
GetLen() uint64 // 数据帧长度 8bytes根据实际情况进行转换
GetBody() []byte // 数据 Body
}
)