codec

package
v0.0.0-...-e66b27f Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2019 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeMessage

func DecodeMessage(msgFullName string, data []byte) (interface{}, *cellnet.MessageMeta, error)

解码消息

func EncodeMessage

func EncodeMessage(msg interface{}, ctx cellnet.ContextSet) (data []byte, meta *cellnet.MessageMeta, err error)

编码消息, 在使用了带内存池的codec中,可以传入session或peer的ContextSet,保存内存池上下文,默认ctx传nil

func FreeCodecResource

func FreeCodecResource(codec cellnet.Codec, data interface{}, ctx cellnet.ContextSet)

Types

type CodecRecycler

type CodecRecycler interface {
	Free(data interface{}, ctx cellnet.ContextSet)
}

Codec.Encode内分配的资源,在必要时可以回收,例如内存池对象

Jump to

Keyboard shortcuts

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