function __construct($host, $port, $ssl = false) { $flag = $ssl ? SWOOLE_SOCK_TCP | SWOOLE_SSL : SWOOLE_SOCK_TCP; if (!empty(self::$options['base'])) { self::$swooleMode = SWOOLE_BASE; } elseif (extension_loaded('swoole')) { self::$swooleMode = SWOOLE_PROCESS; } $this->sw = new \swoole_server($host, $port, self::$swooleMode, $flag); $this->host = $host; $this->port = $port; Swoole\Error::$stop = false; Swoole\JS::$return = true; $this->runtimeSetting = array('backlog' => 128); }
/** * 设置PID文件 * @param $pidFile */ static function setPidFile($pidFile) { self::$pidFile = $pidFile; }