作者:浮尘所惑的猫猫 | 来源:互联网 | 2023-09-18 13:28
12345678910111213141516/** * Server $server * Request $request * int $fd * \Swoft\Db\Exception\D
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| /**
* Server $server
* Request $request
* int $fd
* \Swoft\Db\Exception\DbException
*/
public static function connect(Server $server, Request $request, int $fd)
{
$get = $request->getSwooleRequest()->get;
$id = $get['id'];
/** Redis $red */
$red = App::getBean("IM");
$red->hSet('FD', $id, $fd); |
//如果初始化容器一下 会报错
PHP Fatal error: Uncaught InvalidArgumentException: Bean Swoft\Aop\Aop not exist in /home/ubuntu/game_console/swoft/vendor/swoft/framework/src/Bean/Container.php:75
Stack trace:
0 /home/ubuntu/game_console/swoft/vendor/swoft/framework/src/Bean/BeanFactory.php(76): Swoft\Bean\Container->get('Swoft\Aop\Aop')
1 /home/ubuntu/game_console/swoft/vendor/swoft/framework/src/Core/ApplicationContext.php(86): Swoft\Bean\BeanFactory::getBean('Swoft\Aop\Aop')
2 /home/ubuntu/game_console/swoft/vendor/swoft/framework/src/App.php(124): Swoft\Core\ApplicationContext::getBean('Swoft\Aop\Aop')
3 /home/ubuntu/game_console/swoft/vendor/swoft/framework/src/Helper/Functions.php(97): Swoft\App::getBean('Swoft\Aop\Aop')
4 /home/ubuntu/game_console/swoft/vendor/swoft/framework/src/Proxy/Handler/AopHandler.php(41): bean('Swoft\Aop\Aop')
5 /home/ubuntu/game_console/swoft/vendor/swoft/framework/src/Proxy/Proxy.php(44) : eval()'d code(8): Swoft\Proxy\Handler\AopHandler->invoke('__destruct', Array)
6 /home/ubuntu/game_console/swoft/vendor/ in /home/ubuntu/game_console/swoft/vendor/swoft/framework/src/Bean/Container.php on line 75
[2019-01-13 22:56:55 *18151.0] ERROR zm_deactivate_swoole (ERROR 503): Fatal error: Uncaught InvalidArgumentException: Bean Swoft\Aop\Aop not exist in /home/ubuntu/game_console/swoft/vendor/swoft/framework/src/Bean/Container.php:75
Stack trace:
0 /home/ubuntu/game_console/swoft/vendor/swoft/framework/src/Bean/BeanFactory.php(76): Swoft\Bean\Container->get('Swoft\Aop\Aop')
1 /home/ubuntu/game_console/swoft/vendor/swoft/framework/src/Core/ApplicationContext.php(86): Swoft\Bean\BeanFactory::getBean('Swoft\Aop\Aop')
2 /home/ubuntu/game_console/swoft/vendor/swoft/framework/src/App.php(124): Swoft\Core\ApplicationContext::getBean('Swoft\Aop\Aop')
3 /home/ubuntu/game_console/swoft/vendor/swoft/framework/src/Helper/Functions.php(97): Swoft\App::getBean('Swoft\Aop\Aop')
4 /home/ubuntu/game_console/swoft/vendor/swoft/framework/src/Proxy/Handler/AopHandler.php(41): bean('Swoft\Aop\Aop')
x¸ⴇ¬homeµ㴇 ntu/game_console/swoft/vendor/swoft/framework/src/Proxy/Proxy.php(44) : eval()'d code(8): Swoft\Proxy\Handl!ª
该提问来源于开源项目:swoft-cloud/swoft
可是swoole 提供的webosocket server 不是异步非阻塞的吗 为什么onopen 是同步的?