Swoole
-
Swoole接口
<?php// 编写自己的http服务器/** * 第1个参数, 0.0.0.0 表示监听本机所有的网址地址 * 第2参数,6060 表示监听端口号 当前建议1-1024之间是系统保留不要去用 */$http = new swoole_http_server('0.0.0.0', 6060);// 设置$http->set([ // 工作的进程数量 'worker_num' => 2, // 一个进程请求的最大次数 'max_request' => 1000]);// 相关事件的监听// 开始事件$http->on('start', function (swool
-
编写http服务器
<?php// 编写自己的http服务器/** * 第1个参数, 0.0.0.0 表示监听本机所有的网址地址 * 第2参数,6060 表示监听端口号 当前建议1-1024之间是系统保留不要去用 */$http = new swoole_http_server('0.0.0.0', 6060);// 设置$http->set([ // 工作的进程数量 'worker_num' => 2, // 一个进程请求的最大次数 'max_request' => 1000]);// 相关事件的监听// 开始事件$http->on('start', function (swool