入门指引 Server Client Process AsyncIO Memory HttpServer WebSocket 高级 其他

发布于 2015-08-09 09:49:42 | 165 次阅读 | 评论: 0 | 来源: 网络整理

swoole-1.7.16版本增加了客户端连接迭代器接口,可以非常轻松实现遍历当前服务器的所有连接。

遍历连接并广播

foreach($server->connections as $fd)
{
    $server->send($fd, "hello worldn");
}

获取连接总数

echo count($server->connections);
最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务