<?php$http = new swoole_http_server("0.0.0.0", 9512);
$http->on("start", function ($server) { echo "Swoole http server is started at http://127.0.0.1:9512\n";
});
$http->on("request", function (\swoole_http_request $request, \swoole_http_response $response) { static $a= 0;
$a++;
$response->write("a:".$a.PHP_EOL);
});
$http->start();浏览器请求 http://127.0.0.1:9512第一次输出 a:1第二次输出 a:3第三次输出 a:5第四次输出 a:7环境:| PHP | 7.1.15 || Swoole | 4.0.0 || Laravel Framework | 5.5.26
1 回答
- 1 回答
- 0 关注
- 678 浏览
添加回答
举报
0/150
提交
取消