frontend

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2019 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MsgIDSize = 2 // uint16
)

Variables

View Source
var (
	ErrAlreadyBind           = errors.New("already bind user")
	ErrBackendSDNotFound     = errors.New("backend sd not found")
	ErrBackendServerNotFound = errors.New("backend svc not found")
)
View Source
var (
	PingACKMsgID   = cellnet.MessageMetaByFullName("proto.PingACK").ID
	VerifyREQMsgID = cellnet.MessageMetaByFullName("proto.VerifyREQ").ID
)
View Source
var (
	ErrMaxPacket  = errors.New("packet over size")
	ErrMinPacket  = errors.New("packet short size")
	ErrShortMsgID = errors.New("short msgid")
)

Functions

func ProcFrontendPacket

func ProcFrontendPacket(msgID int, msgData []byte, ses cellnet.Session) (msg interface{}, err error)

func RecvLTVPacketData

func RecvLTVPacketData(reader io.Reader, maxPacketSize int) (msgID int, msgData []byte, err error)

接收Length-Type-Value格式的封包流程

func Start

func Start(param model.FrontendParameter)

func Stop

func Stop()

Types

type FrontendEventHooker

type FrontendEventHooker struct {
}

func (FrontendEventHooker) OnInboundEvent

func (FrontendEventHooker) OnInboundEvent(inputEvent cellnet.Event) (outputEvent cellnet.Event)

网关内部抛出的事件

func (FrontendEventHooker) OnOutboundEvent

func (FrontendEventHooker) OnOutboundEvent(inputEvent cellnet.Event) (outputEvent cellnet.Event)

发送到客户端的消息

Jump to

Keyboard shortcuts

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