public string $type = 'client'
public string $frameBuffer
public string $payloadBuffer
public string $applicationName
public array $ping = array (
'attempts' => 0,
'last' => 0,
'retry' => 5,
'retries' => 3,
)
Any detected time offset. This doesn't need to be exact so we don't bother worrying about latency.
This is an array of eventID and stream pairs.
public array $subscriptions
If the client has any child task.
public __construct(mixed $stream, ?array $options): void
Parameter | Type | Description |
---|
$stream | mixed | |
$options | array | |
public __destruct(): void
Initiates a WebSocket client handshake.
public initiateHandshake(string $request): void
Parameter | Type | Description |
---|
$request | string | |
public recv(string $buf): void
Parameter | Type | Description |
---|
$buf | string | |
public send(string $command, mixed $payload): bool
Parameter | Type | Description |
---|
$command | string | |
$payload | mixed | |
Process a stream client disconnect.
public disconnect(): bool
public commandUnsubscribe(string $eventID): bool
Parameter | Type | Description |
---|
$eventID | string | |
public commandTrigger(string $eventID, mixed $data, bool $echoClient = true): bool
Parameter | Type | Description |
---|
$eventID | string | |
$data | mixed | |
$echoClient | bool | |
public sendEvent(string $eventID, string $triggerID, mixed $data): bool
Parameter | Type | Description |
---|
$eventID | string | |
$triggerID | string | |
$data | mixed | |
Overridden method from WebSocket class to check the requested WebSocket URL is valid.
protected checkRequestURL(string $url, bool $): void
Parameter | Type | Description |
---|
$url | string | |
$ | bool | |
Generate an HTTP response message.
protected httpResponse(int $code, ?string $body, array $headers = []): string
Parameter | Type | Description |
---|
$code | int | HTTP response code |
$body | string | The response body |
$headers | array | Additional headers |
protected write(string $frame): bool
Parameter | Type | Description |
---|
$frame | string | |
Processes a client data frame.
protected processFrame(string $frameBuffer): mixed
Parameter | Type | Description |
---|
$frameBuffer | string | |
protected processCommand(string $command, mixed $payload): bool
Parameter | Type | Description |
---|
$command | string | |
$payload | mixed | |
protected commandAuthorise(\stdClass $payload, bool $acknowledge = true): bool
Parameter | Type | Description |
---|
$payload | \stdClass | |
$acknowledge | bool | |
protected commandStatus(?\stdClass $payload): bool
Parameter | Type | Description |
---|
$payload | \stdClass | |
protected commandSubscribe(string $eventID, ?array $filter): bool
Parameter | Type | Description |
---|
$eventID | string | |
$filter | array | |
protected commandLog(\stdClass $payload): bool
Parameter | Type | Description |
---|
$payload | \stdClass | |
Initiates a WebSocket client handshake.
private initiateWebSocketsHandshake(array $headers): bool
Parameter | Type | Description |
---|
$headers | array | |
Initiates a REST client handshake.
private initiateRESTHandshake(array $headers, string $body): bool
Parameter | Type | Description |
---|
$headers | array | |
$body | string | |
Generated by Hazaar API Doc Generator