\Hazaar\Application
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.

Tags

Since

2.0.0

Package

Core

Summary
Methods Properties Constants
$id
No constants
Properties
$encoded
$encoded
$id
$id
$last_error
$last_error
$typeCodes
$typeCodes
Methods
__construct()
__construct($id, $encoded = true)

Parameters

$id

No description

$encoded

No description

check()
check($type) : mixed
Checks that a protocol message type is valid and returns it's numeric value

Parameters

$typemixed

If $type is a string, it is checked and if valid then it’s numeric value is returned. If $type is an integer it will be returned back if valid. If either is not valid then false is returned.

Returns

mixed

The integer value of the message type. False if the type is not valid.

decode()
decode($packet, $payload = null, $time = null)

Parameters

$packet

No description

$payload

No description

$time

No description

encode()
encode($type, $payload = Array ( ) )

Parameters

$type

No description

$payload

No description

error()
error($msg)

Parameters

$msg

No description

getLastError()
getLastError()
getType()
getType($name)

Parameters

$name

No description

getTypeName()
getTypeName($type)

Parameters

$type

No description