The socket server class.
Creates a socket server that listens on an address and port for incoming connections.
protected int $maxBufferSize
public __construct(string $addr, int $port, int $bufferLength = 2048): void
Parameter | Type | Description |
---|
$addr | string | |
$port | int | |
$bufferLength | int | |
Server main loop.
public run(?int $timeout): void
Parameter | Type | Description |
---|
$timeout | int | |
protected connecting(string $remoteAddr, int $remotePort, string $localAddr, int $localPort): bool
Parameter | Type | Description |
---|
$remoteAddr | string | |
$remotePort | int | |
$localAddr | string | |
$localPort | int | |
protected connected(\Socket $client): void
Parameter | Type | Description |
---|
$client | \Socket | |
protected process(string $message): void
Parameter | Type | Description |
---|
$message | string | |
protected closed(\Socket $client): void
Parameter | Type | Description |
---|
$client | \Socket | |
Generated by Hazaar API Doc Generator