This commit is contained in:
2021-08-02 11:07:15 +08:00
parent f9cf3640ff
commit 9ffb1e5057
5 changed files with 173 additions and 197 deletions
+14
View File
@@ -89,6 +89,7 @@ class Server extends HttpService
* @param $rpcService
* @throws ReflectionException
* @throws NotFindClassException
* @throws ConfigException
*/
private function rpcListener($rpcService)
{
@@ -100,6 +101,19 @@ class Server extends HttpService
$rpcService['events'][Constant::DISCONNECT] = [Service::class, 'onDisconnect'];
$rpcService['events'][Constant::CLOSE] = [Service::class, 'onClose'];
}
$rpcService['settings']['enable_unsafe_event'] = true;
$this->addRpcListener($rpcService);
}
/**
* @param $rpcService
* @throws ConfigException
* @throws NotFindClassException
* @throws ReflectionException
*/
private function addRpcListener($rpcService)
{
$this->manager->addListener($rpcService['type'], $rpcService['host'], $rpcService['port'], $rpcService['mode'], $rpcService);
}