首页  >  文章  >  后端开发  >  Go,PHP,Swoole 并发测试详解

Go,PHP,Swoole 并发测试详解

coldplay.xixi
coldplay.xixi转载
2020-07-02 17:55:332503浏览

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编程从入门到精通

PHP内置服务

echo 1;

Swoole

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

以上是Go,PHP,Swoole 并发测试详解的详细内容。更多信息请关注PHP中文网其他相关文章!

声明:
本文转载于:webhek.com。如有侵权,请联系admin@php.cn删除