Global

Methods

Command(opts)

Process the handshake request.
Parameters:
Name Type Description
opts Object option parameters opts.handshake(msg, cb(err, resp)) handshake callback. msg is the handshake message from client. opts.hearbeat heartbeat interval (level?) opts.version required client level

Command(opts)

Process heartbeat request.
Parameters:
Name Type Description
opts Object option request opts.heartbeat heartbeat interval

configure()

Configure pomelo logger

create(app) → {Server}

Server factory function.
Parameters:
Name Type Description
app Application current application context
Returns:
Server - server instance

Type Definitions

AutoFilters

The Auto loaded filters
Properties:
Name Type Description
serial function
time function
timeout function
toobusy function

AutoRpcFilters

The Auto loaded filters
Properties:
Name Type Description
rpcLog function
toobusy function

Connection

DefaultComponents

The Default Components
Properties:
Name Type Description
__connector__ Connector
__backendSession__ BackendSessionService
__channel__ ChannelService
__server__ ServerComp
__monitor__ MonitorComp
__i18n__ SexPomeloI18n

DefaultConnectors

The connectors
Properties:
Name Type Description
sioconnector string
hybridconnector string
udpconnector string
mqttconnector string

PluginCfg

PluginCfg
Properties:
Name Type Description
package string plugin require path
name String plugin name
serverType String plugin use serverType
cfg Object plugin config

RouteArg

路由Arg
Properties:
Name Type Description
id number id
type number 类型
compressRoute number 是否压缩路由
route number 路由
compressGzip number 是否压缩
body object 数据体
Properties
Name Type Description
data Array.<number> 数据
serName string 服务器名

RouteMsg

路由信息
Properties:
Name Type Description
namespace string 命名空间
serverType string 服务类型
service string 服务
method string 方法
args Array.<RouteArg> 参数

ServerInfo

The ServerInfo
Properties:
Name Type Description
main string The main javascript full path.
env string The run env.
id string The Server ID.
host string The Server run host.
port number The Server run port.
clientPort number The Server run client port.
frontend string The Server is frontend server 'true'|'false' .
serverType string The Server type.

SexAppCfg

Cfg
Properties:
Name Type Description
name string app name
plugins Array.<PluginCfg> 插件