DoraRPC\Server::__construct PHP Method

__construct() final public method

final public __construct ( $ip = "0.0.0.0", $port = 9567, $httpport = 9566 )
    public final function __construct($ip = "0.0.0.0", $port = 9567, $httpport = 9566)
    {
        $this->server = new \swoole_http_server($ip, $httpport);
        //tcp server
        $this->tcpserver = $this->server->addListener($ip, $port, \SWOOLE_TCP);
        //tcp只使用这个事件
        $this->tcpserver->on('Receive', array($this, 'onReceive'));
        //init http server
        $this->server->on('Start', array($this, 'onStart'));
        $this->server->on('ManagerStart', array($this, 'onManagerStart'));
        $this->server->on('ManagerStop', array($this, 'onManagerStop'));
        $this->server->on('Request', array($this, 'onRequest'));
        $this->server->on('WorkerStart', array($this, 'onWorkerStart'));
        $this->server->on('WorkerError', array($this, 'onWorkerError'));
        $this->server->on('Task', array($this, 'onTask'));
        $this->server->on('Finish', array($this, 'onFinish'));
        //invoke the start
        $this->initServer($this->server);
        //store current ip port
        $this->serverIP = $ip;
        $this->serverPort = $port;
    }