Автор: Vasily Zorin (maintainer@daemon.io)
Наследование: implements PHPDaemon\WebSocket\RouteInterface, use trait PHPDaemon\Traits\StaticObjectWatchdog, use trait PHPDaemon\Traits\Sessions, use trait PHPDaemon\Traits\DeferredEventHandlers
Пример #1
0
 public function onHandshake()
 {
     $this->defineLocalMethods(['serverTest' => function () {
         $this->callRemote('clientTest', 'foobar', function () {
             Daemon::log('callback called');
         });
     }]);
     $this->onFrame('{"method":"methods","arguments":[{"clientTest":{}}],"callbacks":{"1":[0,"clientTest"]},"links":[]} ', 'STRING');
     parent::onHandshake();
 }