|
@@ -31,11 +31,12 @@ class MessageController extends AbstractController
|
|
|
// 获取 Swoole WebSocket Server 实例
|
|
// 获取 Swoole WebSocket Server 实例
|
|
|
$server = \Hyperf\Context\ApplicationContext::getContainer()->get(\Swoole\Server::class);
|
|
$server = \Hyperf\Context\ApplicationContext::getContainer()->get(\Swoole\Server::class);
|
|
|
$redisClient = new RedisService();
|
|
$redisClient = new RedisService();
|
|
|
-
|
|
|
|
|
|
|
+ var_dump($adminList, '-------------&&&&&&&&&&&&&&&&&&&&&&----');
|
|
|
if ($adminList && isset($adminList['data'])) {
|
|
if ($adminList && isset($adminList['data'])) {
|
|
|
foreach ($adminList['data'] as $admin) {
|
|
foreach ($adminList['data'] as $admin) {
|
|
|
$fd = $redisClient->findFd((int)$admin['id']);
|
|
$fd = $redisClient->findFd((int)$admin['id']);
|
|
|
if ($fd && $server->isEstablished((int)$fd)) {
|
|
if ($fd && $server->isEstablished((int)$fd)) {
|
|
|
|
|
+ var_dump($fd, '-------------&&&&&&&&&&&&&&&&&&&&&&----');
|
|
|
$server->push((int)$fd, json_encode($data));
|
|
$server->push((int)$fd, json_encode($data));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|