protocol

package
v0.0.0-...-68bdf18 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeadBytes        = 8
	TotalLengthLimit = 102400
)

Variables

This section is empty.

Functions

func DecodeTCPMessage

func DecodeTCPMessage(conn *net.TCPConn) (uint, []byte, error)

func DecodeUDPMessage

func DecodeUDPMessage(conn *net.UDPConn) (uint, *net.UDPAddr, []byte, error)

func EncodeMessage

func EncodeMessage(cmdId uint, pb proto.Message) []byte

Types

type MsgHead

type MsgHead struct {
	CmdId  uint32 //必须是明确字节数的类型,不然buf.Read可能有问题
	Length uint32
}

Jump to

Keyboard shortcuts

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