grpc

package
v0.0.0-...-5b4c1f5 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoginHandler

func LoginHandler(agent network.IAgentAdapter, m transport.IMessage) error

LoginHandler request login

func ModuleCreate

func ModuleCreate() (server.Module, error)

ModuleCreate module create function

func NewAgentAdapter

func NewAgentAdapter(conn network.IConn) network.IAgentAdapter

NewAgentAdapter create agent adapter

Types

type AgentAdapter

type AgentAdapter struct {
	network.AgentAdapter
}

AgentAdapter do agent hander

func (*AgentAdapter) OnClose

func (a *AgentAdapter) OnClose()

OnClose agent close and clear

func (*AgentAdapter) ProcessMessage

func (a *AgentAdapter) ProcessMessage(payload interface{}) error

ProcessMessage process request and notify message

type Module

type Module struct {
	server.BaseContext
	// contains filtered or unexported fields
}

Module struct to define module

func (*Module) OnRun

func (s *Module) OnRun(dt time.Duration)

OnRun goruntine run and call OnRun , always use ModuleRun to call this function

func (*Module) Setup

func (s *Module) Setup(conf server.IConfig) (server.Module, error)

Setup init custom module and pass config map to module config

m := map[string]interface{}{
 "queueSize":1000,
 "grpcAddress":":14000",
	"maxConnNum":1024,
 "socketQueueSize":100,
 "maxMessageSize":4096
}

Jump to

Keyboard shortcuts

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