public function start()
    {
        // Linsten http Event
        $this->server->on('request', [$this, 'onRequest']);

        $this->server->on('start', [$this, 'onStart']);
        $this->server->on('shutdown', [$this, 'onShutdown']);

        $this->server->on('workerStart', [$this, 'onWorkerStart']);
        $this->server->on('workerStop', [$this, 'onWorkerStop']);
        $this->server->on('workerError', [$this, 'onWorkerError']);

        // listen websocket
        if ( !empty($this->config['enable_websocket']) ) {
            $this->server->on('open', [$this, 'onOpen']);
            $this->server->on('message', [$this, 'onMessage']);
            $this->server->on('close', [$this, 'onClose']);
        }

        // Add event Listener
        $this->add_event_listener('onBoot');

        // Start a new http server
        $this->server->start();
    }
public function start()
    {
        // Linsten http Event
        $this->server->on('request', [$this, 'onRequest']);

        $this->server->on('start', [$this, 'onStart']);
        $this->server->on('shutdown', [$this, 'onShutdown']);

        $this->server->on('workerStart', [$this, 'onWorkerStart']);
        $this->server->on('workerStop', [$this, 'onWorkerStop']);
        $this->server->on('workerError', [$this, 'onWorkerError']);

        // listen websocket
        if ( !empty($this->config['enable_websocket']) ) {
            $this->server->on('open', [$this, 'onOpen']);
            $this->server->on('message', [$this, 'onMessage']);
            $this->server->on('close', [$this, 'onClose']);
        }

        // Add event Listener
        $this->add_event_listener('onBoot');

        // Start a new http server
        $this->server->start();
    }
public function start ( ) { // Linsten http Event $ this -> server -> on ( 'request' , [ $ this , 'onRequest' ] ) ; $ this -> server -> on ( 'start' , [ $ this , 'onStart' ] ) ; $ this -> server -> on ( 'shutdown' , [ $ this , 'onShutdown' ] ) ; $ this -> server -> on ( 'workerStart' , [ $ this , 'onWorkerStart' ] ) ; $ this -> server -> on ( 'workerStop' , [ $ this , 'onWorkerStop' ] ) ; $ this -> server -> on ( 'workerError' , [ $ this , 'onWorkerError' ] ) ; // listen websocket if ( ! empty ( $ this -> config [ 'enable_websocket' ] ) ) { $ this -> server -> on ( 'open' , [ $ this , 'onOpen' ] ) ; $ this -> server -> on ( 'message' , [ $ this , 'onMessage' ] ) ; $ this -> server -> on ( 'close' , [ $ this , 'onClose' ] ) ; } // Add event Listener $ this -> add_event_listener ( 'onBoot' ) ; // Start a new http server $ this -> server -> start ( ) ; }
Start swoole server

@return null
Start swoole server