protocol

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Content

type Content struct {
	Id   uint8  // 标识哪个协议
	Name string // 协议名字
}

Content 协议内容

type Protocol

type Protocol interface {
	// 协议内容
	GetContent() *Content
	// 封包,即将message写入connection
	Pack(traffic.Message) error
	// 拆包,从connection中读取消息,读到message中
	UnPack(traffic.Message, func(header traffic.Header) error) error
}

Protocol 协议接口

Jump to

Keyboard shortcuts

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