echo

package
v0.0.0-...-c53b007 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UsMessage

type UsMessage struct {
	Header  UsMessageHeader
	Content []byte
}

UsMessage defines the 'US' type message.

func (UsMessage) DeserializeMessage

func (em UsMessage) DeserializeMessage(data []byte) (message tao.Message, err error)

DeserializeMessage deserializes bytes into Message.

func (UsMessage) MessageHeadHandler

func (em UsMessage) MessageHeadHandler(data []byte) (uint, error)

MessageHeadHandler 根据消息头返回消息体长度

func (UsMessage) MessageNumber

func (em UsMessage) MessageNumber() uint16

MessageNumber returns message type number.

func (UsMessage) MessageTypeHandler

func (em UsMessage) MessageTypeHandler(msgtype uint16) (uint, error)

MessageTypeHandler 根据消息类型返回消息头剩余长度

func (UsMessage) ProcessMessage

func (em UsMessage) ProcessMessage(ctx context.Context, conn tao.WriteCloser)

ProcessMessage process the logic of echo message.

func (UsMessage) Serialize

func (em UsMessage) Serialize() ([]byte, error)

Serialize serializes Message into bytes.

type UsMessageHeader

type UsMessageHeader struct {
	Type     uint16
	Version  uint8
	Session  [12]byte
	Encrypt  uint8
	Command  uint16
	BodySize uint16
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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