依旧参考官网
示例二:
count = 4;// 当收到客户端发来的数据后返回hello $data给客户端$ws_worker->onMessage = function(TcpConnection $connection, $data){ // 向客户端发送hello $data $connection->send('hello ' . $data);};// 运行workerWorker::runAll();
php ws_test.php start 启动服务php ws_test.php start -d 守护进程启动
来源地址:https://blog.csdn.net/qq_43515054/article/details/128192359