TypePHP 编译器 https://swoole.com/aot/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

13 lines
316 B

<?php
use Swoole\Server;
function main()
{
$serv = new Server("0.0.0.0", 9501);
$serv->on('receive', function (Server $serv, $fd, $reactor_id, $data) {
echo "[#" . $serv->worker_id . "]\tClient[$fd] receive data: $data\n";
$serv->send($fd, "hello {$data}\n");
});
$serv->start();
}