swoole 基础知识

时间:2022-03-12 00:56:01

$host = 127.0.0.1  监听本地ip

$host = 255.3.258.139  监听外网的某个ip

$host= 0.0.0.0 监听所有ip

$ws = new swoole_websocket_server($htos, 9501);

$ws = new swoole_websocket_server("0.0.0.0", );

$ws->set([
'max_request'=>
]);

max_request  worker最大任务数,只接收8个链接,超过的部分会把会前面的资源断开(断开旧链接,重新释放资源)