PHP 클래스 MyQEE\Server\RPC

在客户端使用 \RPC::Client() 来获取对象, 不要使用 new RPC() 方式来构造对象 用于提供暴露出来的方法, 对象参数
파일 보기 프로젝트 열기: myqee/server

공개 프로퍼티들

프로퍼티 타입 설명
$RPC_KEY string 此RPC通讯密钥
$__instance

공개 메소드들

메소드 설명
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 服务器上触发客户端一个事件

보호된 메소드들

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

메소드 상세

Client() 공개 정적인 메소드

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

__construct() 공개 메소드

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

_getRpcKey() 공개 정적인 메소드

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

closeClient() 보호된 메소드

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

connectionInfo() 보호된 메소드

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

disableReuse() 보호된 메소드

取消可复用
protected disableReuse ( )

enableReuse() 보호된 메소드

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

factory() 공개 정적인 메소드

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

isClosedByServer() 공개 메소드

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

trigger() 공개 메소드

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

프로퍼티 상세

$RPC_KEY 공개적으로 정적으로 프로퍼티

此RPC通讯密钥
public static string $RPC_KEY
리턴 string

$__instance 공개적으로 정적으로 프로퍼티

public static $__instance