PHP Class MyQEE\Server\RPC

在客户端使用 \RPC::Client() 来获取对象, 不要使用 new RPC() 方式来构造对象 用于提供暴露出来的方法, 对象参数
Afficher le fichier Open project: myqee/server

Méthodes publiques

Свойство Type Description
$RPC_KEY string 此RPC通讯密钥
$__instance

Méthodes publiques

Méthode Description
Client ( ) : static | Client 返回PRC调用的客户端, 客户端使用
__construct ( $fd, integer $fromId )
_getRpcKey ( ) : string 返回当前RPC的通讯密钥
factory ( $fd, null $fromId = null ) : static
isClosedByServer ( ) : boolean 是否被服务器强制关闭连接的
trigger ( $event, null $arg1 = null, null $arg2 = null ) : boolean 服务器上触发客户端一个事件

Méthodes protégées

Méthode Description
closeClient ( $msg = null ) 关闭当前RPC客户端连接
connectionInfo ( ) : array | boolean 返回当前RPC连接的信息
disableReuse ( ) 取消可复用
enableReuse ( ) 设置此对象为可复用

Method Details

Client() public static méthode

返回PRC调用的客户端, 客户端使用
public static Client ( ) : static | Client
Résultat static | MyQEE\Server\RPC\Client

__construct() public méthode

public __construct ( $fd, integer $fromId )
$fd
$fromId integer

_getRpcKey() public static méthode

返回当前RPC的通讯密钥
public static _getRpcKey ( ) : string
Résultat string

closeClient() protected méthode

关闭当前RPC客户端连接
protected closeClient ( $msg = null )

connectionInfo() protected méthode

额外提供 fd 和 from_id
protected connectionInfo ( ) : array | boolean
Résultat array | boolean

disableReuse() protected méthode

取消可复用
protected disableReuse ( )

enableReuse() protected méthode

系统会为每个客户端创建一个对象RPC的对象, 调用完毕后销毁, 设置后只要客户端没有断开则不会销毁 可以使用 $this->release() 释放对象
protected enableReuse ( )

factory() public static méthode

public static factory ( $fd, null $fromId = null ) : static
$fd
$fromId null
Résultat static

isClosedByServer() public méthode

是否被服务器强制关闭连接的
public isClosedByServer ( ) : boolean
Résultat boolean

trigger() public méthode

服务器上触发客户端一个事件
public trigger ( $event, null $arg1 = null, null $arg2 = null ) : boolean
$event
$arg1 null
$arg2 null
Résultat boolean

Property Details

$RPC_KEY public_oe static_oe property

此RPC通讯密钥
public static string $RPC_KEY
Résultat string

$__instance public_oe static_oe property

public static $__instance