$io->on('connection', function($socket)use($io){ echo "new connection coming\n"; $time_interval = 3; $n = 0; Timer::add($time_interval, function() { global $io,$n;...
<?php require_once __DIR__ . '/vendor/autoload.php'; use Workerman\Worker; use Workerman\Lib\Timer; use PHPSocketIO\SocketIO; $io = new SocketIO(81); // 当有客户端连接时 $io->on('connection', function($socket)us...