摘要: 1.创建服务端server.php <?php $http = new Swoole\Http\Server('0.0.0.0', 6666); $http->on('Request', function ($request, $response) { $response->header('Cont 阅读全文
posted @ 2022-06-24 23:20 快乐的在一起 阅读(72) 评论(0) 推荐(0) 编辑
摘要: 1.创建客户端数据 client.php <?php //连接Swoole tcp服务 $client = new Swoole\Client(SWOOLE_SOCK_TCP); if (!$client->connect('127.0.0.1', 1111, 0.5)) { echo "conne 阅读全文
posted @ 2022-06-24 18:18 快乐的在一起 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 1.创建 server.php <?php //创建Server对象,监听 127.0.0.1:9501 端口 $server = new Swoole\Server('127.0.0.1', 1111); $server->set([ 'worker_num'=>8, //worker进程数,cp 阅读全文
posted @ 2022-06-24 17:11 快乐的在一起 阅读(31) 评论(0) 推荐(0) 编辑
摘要: 转载链接:https://blog.csdn.net/ningmengshuxiawo/article/details/115413766 TCP和UDP都是传输层协议 TCP TCP 是一种面向有连接的传输层协议,能够对自己提供的连接实施控制。适用于要求可靠传输的应用,例如文件传输。面向字节流,传 阅读全文
posted @ 2022-06-24 10:24 快乐的在一起 阅读(78) 评论(0) 推荐(0) 编辑