Connection
Less than 1 minute
Connection
Contract for Warlock transport connections.
interface ConnectionMethods
__construct
Creates a connection implementation bound to a Warlock protocol handler.
public __construct(Protocol $protocol, ?string $guid): voidParameters
| Parameter | Type | Description |
|---|---|---|
$protocol | Protocol | |
$guid | string |
configure
Configure the connection.
public configure(array $config): voidParameters
| Parameter | Type | Description |
|---|---|---|
$config | array |
getHost
Returns the connection host name or address.
public getHost(): stringgetPort
Returns the remote connection port.
public getPort(): intconnect
Opens the underlying connection.
public connect(): booldisconnect
Closes the underlying connection.
public disconnect(): boolconnected
Returns whether the underlying transport is currently connected.
public connected(): boolsend
Sends a command packet over the connection.
public send(PacketType $command, mixed $payload): boolParameters
| Parameter | Type | Description |
|---|---|---|
$command | PacketType | |
$payload | mixed |
recv
Receives a packet and optionally writes its payload by reference.
public recv(mixed $payload, int $tvSec = 3, int $tvUsec): nullParameters
| Parameter | Type | Description |
|---|---|---|
$payload | mixed | |
$tvSec | int | |
$tvUsec | int |
Generated by Hazaar API Doc Generator on Tue, 21 Apr 2026 04:00:25 +0000