function eventLoop() { set_time_limit(0); ob_start(); echo str_repeat('', 4096); ob_end_flush(); ob_flush(); $i = 1; while (true) { echo $i++ , ' '; ob_flush(); flush(); sleep(1); } }
简单的长连接
最新推荐文章于 2019-06-12 10:45:22 发布
function eventLoop() { set_time_limit(0); ob_start(); echo str_repeat('', 4096); ob_end_flush(); ob_flush(); $i = 1; while (true) { echo $i++ , ' '; ob_flush(); flush(); sleep(1); } }