echo

package
v2.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 20, 2020 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EchoPacket

type EchoPacket struct {
	// contains filtered or unexported fields
}
func NewWallPacket(buff[] byte,hasLengthField bool,tyc int32) *EchoPacket {
	p := &EchoPacket{}
	if hasLengthField {
		p.buff = buf
	} else {
		p.buff = make([]byte, 4+len(buff))
		binary.BigEndian.PutUint16(p.buff[0:2],uint16(len(buff) + 2))
		binary.BigEndian.PutUint16(p.buff[2:4],uint16(tyc))
		copy(p.buff[4:],buff)
	}
}

func NewEchoPacket

func NewEchoPacket(buff []byte, hasLengthField bool, tyc int32) *EchoPacket

func (*EchoPacket) GetBody

func (this *EchoPacket) GetBody() []byte

func (*EchoPacket) GetLength

func (this *EchoPacket) GetLength() uint16

func (*EchoPacket) GetType

func (this *EchoPacket) GetType() uint16

func (*EchoPacket) Serialize

func (this *EchoPacket) Serialize() []byte

type EchoProtocol

type EchoProtocol struct {
}

func (*EchoProtocol) ReadPacket

func (this *EchoProtocol) ReadPacket(conn *net.TCPConn) (gotcp.Packet, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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