PHP Class GatewayProtocol, thinksns

struct GatewayProtocol { unsigned int pack_len, unsigned char cmd,//命令字 unsigned int local_ip, unsigned short local_port, unsigned int client_ip, unsigned short client_port, unsigned int client_id, unsigned char flag, unsigned int ext_len, char[ext_len] ext_data, char[pack_length-HEAD_LEN] body//包体 }
Author: walkor ([email protected])
ファイルを表示 Open project: medz/thinksns-4 Class Usage Examples

Public Properties

Property Type Description
$empty

Public Methods

Method Description
decode ( string $buffer ) : array 从二进制数据转换为数组
encode ( array $data ) : string 获取整个包的buffer
input ( string $buffer ) : integer 返回包长度

Method Details

decode() public static method

从二进制数据转换为数组
public static decode ( string $buffer ) : array
$buffer string
return array

encode() public static method

获取整个包的buffer
public static encode ( array $data ) : string
$data array
return string

input() public static method

返回包长度
public static input ( string $buffer ) : integer
$buffer string
return integer return current package length

Property Details

$empty public_oe static_oe property

public static $empty