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])
Afficher le fichier Open project: medz/thinksns-4 Class Usage Examples

Méthodes publiques

Свойство Type Description
$empty

Méthodes publiques

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

Method Details

decode() public static méthode

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

encode() public static méthode

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

input() public static méthode

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

Property Details

$empty public_oe static_oe property

public static $empty