From a9369726147c7499e0016e183d5d56a7b44efe4b Mon Sep 17 00:00:00 2001 From: Liam Date: Sat, 18 Feb 2023 16:26:48 -0500 Subject: service: refactor server architecture Converts services to have their own processes --- src/core/hle/service/ldn/ldn.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/core/hle/service/ldn/ldn.cpp') diff --git a/src/core/hle/service/ldn/ldn.cpp b/src/core/hle/service/ldn/ldn.cpp index e5099d61f..4c2abe7d3 100644 --- a/src/core/hle/service/ldn/ldn.cpp +++ b/src/core/hle/service/ldn/ldn.cpp @@ -8,6 +8,7 @@ #include "core/hle/service/ldn/ldn.h" #include "core/hle/service/ldn/ldn_results.h" #include "core/hle/service/ldn/ldn_types.h" +#include "core/hle/service/server_manager.h" #include "core/internal_network/network.h" #include "core/internal_network/network_interface.h" #include "network/network.h" @@ -106,7 +107,7 @@ class IUserLocalCommunicationService final : public ServiceFramework { public: explicit IUserLocalCommunicationService(Core::System& system_) - : ServiceFramework{system_, "IUserLocalCommunicationService", ServiceThreadType::CreateNew}, + : ServiceFramework{system_, "IUserLocalCommunicationService"}, service_context{system, "IUserLocalCommunicationService"}, room_network{system_.GetRoomNetwork()}, lan_discovery{room_network} { // clang-format off @@ -730,12 +731,15 @@ public: } }; -void InstallInterfaces(SM::ServiceManager& sm, Core::System& system) { - std::make_shared(system)->InstallAsService(sm); - std::make_shared(system)->InstallAsService(sm); - std::make_shared(system)->InstallAsService(sm); - std::make_shared(system)->InstallAsService(sm); - std::make_shared(system)->InstallAsService(sm); +void LoopProcess(Core::System& system) { + auto server_manager = std::make_unique(system); + + server_manager->RegisterNamedService("ldn:m", std::make_shared(system)); + server_manager->RegisterNamedService("ldn:s", std::make_shared(system)); + server_manager->RegisterNamedService("ldn:u", std::make_shared(system)); + server_manager->RegisterNamedService("lp2p:app", std::make_shared(system)); + server_manager->RegisterNamedService("lp2p:sys", std::make_shared(system)); + ServerManager::RunServer(std::move(server_manager)); } } // namespace Service::LDN -- cgit v1.2.3