public function start() { if (!empty($this->handler_config)) { $this->server->set($this->handler_config); } $this->defaultProtocol = $this->wrapper_config['websocket_default_protocol']; static::registerCodec($this->wrapper_config['websocket_protocols']); $this->callbacks = array_merge(['HandShake' => [$this, 'onHandShake'], 'Message' => [$this, 'onMessage'], 'Close' => [$this, 'onClose'], 'Task' => [static::class, 'onTask'], 'Finish' => [static::class, 'onFinish']], $this->callbacks); parent::start(); }