packet

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2021 License: MIT Imports: 2 Imported by: 5

Documentation

Index

Constants

View Source
const (

	// Handshake represents a handshake: request(client) <====> handshake response(server)
	Handshake = 0x01

	// HandshakeAck represents a handshake ack from client to server
	HandshakeAck = 0x02

	// Heartbeat represents a heartbeat
	Heartbeat = 0x03

	// Data represents a common data packet
	Data = 0x04

	// Kick represents a kick off packet
	Kick = 0x05 // disconnect message from server
)

Variables

View Source
var ErrInvalidPomeloHeader = errors.New("invalid header")

ErrInvalidPomeloHeader represents an invalid header

View Source
var ErrWrongPomeloPacketType = errors.New("wrong packet type")

ErrWrongPomeloPacketType represents a wrong packet type.

Functions

This section is empty.

Types

type Packet

type Packet struct {
	Type   Type
	Length int
	Data   []byte
}

Packet represents a network packet.

func New

func New() *Packet

New create a Packet instance.

func (*Packet) String

func (p *Packet) String() string

String represents the Packet's in text mode.

type Type

type Type byte

Type represents the network packet's type such as: handshake and so on.

Jump to

Keyboard shortcuts

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