ice framework documentation ice doc v1.10.1
Methods
  • setVerbose(variable $verbose) : void
  • getAddress() : void
  • getServer() : void
  • getClients() : void
  • __construct(string $address, array $options) : void
    Create an instance.
  • run() : void
    Start processing requests. This method runs in an infinite loop.
  • connect(resource $socket) : bool
    Connect a socket to the server.
  • disconnect(resource $socket) : void
    Disconnect a socket from the server.
  • onValidate(callable $callback) : void
    Set a callback to be executed when a client connects, returning `false` will prevent the client from connecting.
  • onConnect(callable $callback) : void
    Set a callback to be executed when a client is connected.
  • onDisconnect(callable $callback) : void
    Set a callback to execute when a client disconnects.
  • onMessage(callable $callback) : void
    Set a callback to execute when a client sends a message.
  • onTick(callable $callback) : void
    Set a callback to execute every few milliseconds.
  • onBoot(callable $callback) : void
    Set a callback to execute on boot the server.
  • callback(string $key, callable $callback) : void
    Register a callback to execute.
Methods Details
  • 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()