protocol

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyDecoder      = "decoder"
	KeyDecodeBuffer = "decode_buf"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EchoMessage

type EchoMessage struct {
	Content string
}

func NewEchoMessage

func NewEchoMessage(data string) *EchoMessage

func (*EchoMessage) Id

func (m *EchoMessage) Id() uint64

type EchoProtocol

type EchoProtocol struct{}

func (*EchoProtocol) Decode

func (p *EchoProtocol) Decode(session *knet.IoSession, reader io.Reader) (m knet.Message, err error)

func (*EchoProtocol) Encode

func (p *EchoProtocol) Encode(session *knet.IoSession, m knet.Message) (data []byte, err error)

Jump to

Keyboard shortcuts

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