PHP Class MyQEE\Server\RPC

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

Public Properties

Property Type Description
$RPC_KEY string 此RPC通讯密钥
$__instance

Public Methods

Method 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 服务器上触发客户端一个事件

Protected Methods

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

Method Details

Client() public static method

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

__construct() public method

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

_getRpcKey() public static method

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

closeClient() protected method

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

connectionInfo() protected method

额外提供 fd 和 from_id
protected connectionInfo ( ) : array | boolean
return array | boolean

disableReuse() protected method

取消可复用
protected disableReuse ( )

enableReuse() protected method

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

factory() public static method

public static factory ( $fd, null $fromId = null ) : static
$fd
$fromId null
return static

isClosedByServer() public method

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

trigger() public method

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

Property Details

$RPC_KEY public_oe static_oe property

此RPC通讯密钥
public static string $RPC_KEY
return string

$__instance public_oe static_oe property

public static $__instance