.
3ss.cn

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内置服务

echo 1;

Swoole

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

赞(0)
未经允许不得转载:互联学术 » Go,PHP,Swoole 并发测试详解

评论 抢沙发