packet

package
v1.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: May 23, 2017 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULE_HEADER           = "[**********]"
	DEFAULT_HEADER_LENGTH    = 12
	DEFAULT_SAVE_DATA_LENGTH = 4
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Packet

type Packet struct {
	Header         string
	HeaderLengh    int32
	SaveDataLength int32
	Data           []byte
}

func NewDefaultPacket

func NewDefaultPacket(data []byte) *Packet

create default package

func (*Packet) BytesToInt

func (self *Packet) BytesToInt(data []byte) int32

func (*Packet) IntToBytes

func (self *Packet) IntToBytes(i int32) []byte

func (*Packet) Packet

func (self *Packet) Packet() []byte

convert to net package

func (*Packet) SetHeader

func (self *Packet) SetHeader(header string) *Packet

set delimiter header

func (*Packet) UnPacket

func (self *Packet) UnPacket(readerChannel chan []byte) []byte

return value is sticky data

Jump to

Keyboard shortcuts

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