PHP Class MyQEE\Server\RPC\Server

Inheritance: extends MyQEE\Server\WorkerTCP
Datei anzeigen Open project: myqee/server Class Usage Examples

Public Properties

Property Type Description
$EOF string 数字 3338 使用 msgpack 编码后会产生一个 \r\n, 所以切不可只用 \r\n 做分隔符
$defaultRPC string RPC 对象名
$forbiddenAction array 不允许调用的方法, 全小写, 下划线(_)开头的的方法已经默认不允许了

Protected Properties

Property Type Description
$setting array 默认监听设置

Public Methods

Method Description
decryption ( $data, $key = null, $rpc = null ) : false | mixed 解密数据
encrypt ( mixed $data, $key = null, $rpc = null ) : string 加密数据
listen ( $ip, $port ) 监听一个端口
onPipeMessage ( Swoole\Server $server, integer $fromWorkerId, mixed $message, $serverId ) : mixed 接受到任意进程的调用
onReceive ( Swoole\Server $server, $fd, $fromId, $data ) 收到信息

Protected Methods

Method Description
call ( $fd, $fromId, stdClass $data )
rc4 ( string $string, string $isDecode = true, string $key = null, number $expiry ) : string 优化版rc4加密解密

Method Details

call() protected method

protected call ( $fd, $fromId, stdClass $data )
$data stdClass

decryption() public static method

解密数据
public static decryption ( $data, $key = null, $rpc = null ) : false | mixed
$data
return false | mixed

encrypt() public static method

加密数据
public static encrypt ( mixed $data, $key = null, $rpc = null ) : string
$data mixed
return string

listen() public method

监听一个端口
public listen ( $ip, $port )
$ip
$port

onPipeMessage() public method

接受到任意进程的调用
public onPipeMessage ( Swoole\Server $server, integer $fromWorkerId, mixed $message, $serverId ) : mixed
$server Swoole\Server
$fromWorkerId integer
$message mixed
return mixed

onReceive() public method

收到信息
public onReceive ( Swoole\Server $server, $fd, $fromId, $data )
$server Swoole\Server
$fd
$fromId
$data

rc4() protected static method

优化版rc4加密解密
protected static rc4 ( string $string, string $isDecode = true, string $key = null, number $expiry ) : string
$string string
$isDecode string
$key string
$expiry number
return string

Property Details

$EOF public_oe static_oe property

数字 3338 使用 msgpack 编码后会产生一个 \r\n, 所以切不可只用 \r\n 做分隔符
public static string $EOF
return string

$defaultRPC public_oe static_oe property

RPC 对象名
public static string $defaultRPC
return string

$forbiddenAction public_oe static_oe property

不允许调用的方法, 全小写, 下划线(_)开头的的方法已经默认不允许了
public static array $forbiddenAction
return array

$setting protected_oe property

默认监听设置
protected array $setting
return array