Server
extends AbstractWorker
in package
uses
ServerMethods
网络进程
- http server
- websocket server
- tcp server
- udp server
Table of Contents
Properties
- $consumerCount : int
- 请求消费者协程数量,0为无限
Methods
- __init__serverMethods() : void
- 初始化服务
- getConnectionCoroutineCount() : array<string|int, int>|int
- 获取连接的协程计数
- getParentOnClose() : null|callable
- getParentOnConnect() : null|callable
- getParentOnMessage() : null|callable
- setConnectionCoroutine() : void
- 设置连接创建/关闭协程化
- unsetConnectionCoroutineCount() : void
- 回收连接的协程计数
Properties
$consumerCount
请求消费者协程数量,0为无限
public
static int
$consumerCount
= 0
Methods
__init__serverMethods()
初始化服务
public
__init__serverMethods() : void
getConnectionCoroutineCount()
获取连接的协程计数
public
static getConnectionCoroutineCount([string|null $connectionId = null ]) : array<string|int, int>|int
Parameters
- $connectionId : string|null = null
Return values
array<string|int, int>|intgetParentOnClose()
public
getParentOnClose() : null|callable
Tags
Return values
null|callablegetParentOnConnect()
public
getParentOnConnect() : null|callable
Tags
Return values
null|callablegetParentOnMessage()
public
getParentOnMessage() : null|callable
Tags
Return values
null|callablesetConnectionCoroutine()
设置连接创建/关闭协程化
public
setConnectionCoroutine(bool $connectionCoroutine) : void
Parameters
- $connectionCoroutine : bool
unsetConnectionCoroutineCount()
回收连接的协程计数
public
static unsetConnectionCoroutineCount(string $connectionId[, bool $force = false ]) : void
Parameters
- $connectionId : string
- $force : bool = false