Protocol
Less than 1 minute
Protocol
Hazaar Application Protocol Class
The Application Protocol is a simple protocol developed to allow communication between parts of the Hazaar framework over the wire or other IO interfaces. It allows common information to be encoded/decoded between endpoints.
Properties
sid
private string $sid
lastError
private string $lastError
encoded
private bool $encoded = true
Methods
__construct
public __construct(string $sid, bool $encoded = true): void
Parameters
Parameter | Type | Description |
---|---|---|
$sid | string | |
$encoded | bool |
getLastError
public getLastError(): string
encoded
public encoded(): bool
encode
public encode(PacketType $type, mixed $payload): string
Parameters
Parameter | Type | Description |
---|---|---|
$type | PacketType | |
$payload | mixed |
decode
public decode(string $packet, mixed $payload, ?int $time): PacketType
Parameters
Parameter | Type | Description |
---|---|---|
$packet | string | |
$payload | mixed | |
$time | int |
error
private error(string $msg): false
Parameters
Parameter | Type | Description |
---|---|---|
$msg | string |
Generated by Hazaar API Doc Generator on Wed, 25 Jun 2025 06:07:11 +0000