站长资讯网
最全最丰富的资讯网站

Go,PHP,Swoole 并发测试详解

Go,PHP,Swoole 并发测试详解

Go

package mainimport (     "fmt"     _ "fmt"     "net/http"     _ "os")func main() {     http.HandleFunc("/", handle)     http.ListenAndServe("0.0.0.0:8082",nil)}func handle(w http.ResponseWriter,r *http.Request) {     fmt.Fprint(w,"URL=",r.URL.Path)     fmt.Println(r.RequestURI)}

相关学习推荐:PHP编程从入门到精通

Go,PHP,Swoole 并发测试详解

PHP内置服务

echo 1;

Go,PHP,Swoole 并发测试详解

Swoole

$http = new SwooleHttpServer("0.0.0.0", 9501);$http->on('request', function ($request, $response) {     echo 1;});$http->start();

Go,PHP,Swoole 并发测试详解

赞(0)
分享到: 更多 (0)
网站地图   沪ICP备18035694号-2    沪公网安备31011702889846号