protocol

package
v0.0.0-...-520f2b6 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2018 License: BSD-2-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PacketHeadSize = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PingPacket

type PingPacket struct {
	BodyLen uint16
	Body    []byte
}

func NewPingPacket

func NewPingPacket(body []byte) *PingPacket

func (*PingPacket) Marshal

func (self *PingPacket) Marshal() []byte

type PingProtocol

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

func (*PingProtocol) OnMessage

func (self *PingProtocol) OnMessage(fn func(c *tcpsock.TcpConn, p *PingPacket))

func (*PingProtocol) Parse

func (self *PingProtocol) Parse(b []byte, recvChan chan<- tcpsock.Packet)

func (*PingProtocol) Process

func (self *PingProtocol) Process(conn *tcpsock.TcpConn, p tcpsock.Packet)

Jump to

Keyboard shortcuts

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