-
-
getAddress() : void
-
getServer() : void
-
getClients() : void
-
Create an instance.
-
run() : voidStart processing requests. This method runs in an infinite loop.
-
Connect a socket to the server.
-
Disconnect a socket from the server.
-
Set a callback to be executed when a client connects, returning `false` will prevent the client from connecting.
-
Set a callback to be executed when a client is connected.
-
Set a callback to execute when a client disconnects.
-
Set a callback to execute when a client sends a message.
-
Set a callback to execute every few milliseconds.
-
Set a callback to execute on boot the server.
-
Register a callback to execute.
-
public function setVerbose(variable $verbose)
-
public function getAddress()
-
public function getServer()
-
public function getClients()
-
public function __construct(string $address, array $options)
Create an instance. -
public function run()
Start processing requests. This method runs in an infinite loop. -
protected function connect(resource $socket)
Connect a socket to the server. -
public function disconnect(resource $socket)
Disconnect a socket from the server. -
public function onValidate(callable $callback)
Set a callback to be executed when a client connects, returning `false` will prevent the client from connecting.The callable will receive: - an associative array with client data - the current server instance The callable should return `true` if the client should be allowed to connect or `false` otherwise. -
public function onConnect(callable $callback)
Set a callback to be executed when a client is connected.The callable will receive: - an associative array with client data - the current server instance -
public function onDisconnect(callable $callback)
Set a callback to execute when a client disconnects.The callable will receive: - an associative array with client data - the current server instance -
public function onMessage(callable $callback)
Set a callback to execute when a client sends a message.The callable will receive: - an associative array with client data - the message string - the current server instance -
public function onTick(callable $callback)
Set a callback to execute every few milliseconds.The callable will receive the server instance. If it returns boolean `false` the server will stop listening. -
public function onBoot(callable $callback)
Set a callback to execute on boot the server.The callable will receive the server instance. -
public function callback(string $key, callable $callback)
Register a callback to execute. -
internal function zephir_init_properties_Ice_Cli_Websocket_Server()