Connection
Less than 1 minute
Connection
- Full name:
\Hazaar\Warlock\Interfaces\Connection
Methods
__construct
public __construct(\Hazaar\Warlock\Protocol $protocol, ?string $guid = null): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$protocol | \Hazaar\Warlock\Protocol | |
$guid | ?string |
connect
Connect to the Warlock server.
public connect(string $applicationName, string $host, int $port, null|string[] $extra_headers = null): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$applicationName | string | The name of the application connecting |
$host | string | The host name or IP address of the Warlock server |
$port | int | The port number of the Warlock server |
$extra_headers | null|string[] | Additional headers to send with the connection |
disconnect
public disconnect(): bool
connected
public connected(): bool
send
public send(string $command, mixed $payload = null): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$command | string | |
$payload | mixed |
recv
public recv(mixed& $payload = null, int $tv_sec = 3, int $tv_usec): null|bool|string
Parameters:
Parameter | Type | Description |
---|---|---|
$payload | mixed | |
$tv_sec | int | |
$tv_usec | int |
Automatically generated on 2024-11-14