PHPDaemon\WebSocket\Route::onHandshake PHP Method

onHandshake() public method

Called when the connection is handshaked.
public onHandshake ( ) : void
return void
    public function onHandshake()
    {
    }

Usage Example

Example #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();
 }