summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/sockets
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2023-02-18 22:26:48 +0100
committerLiam <byteslice@airmail.cc>2023-02-21 18:19:25 +0100
commita9369726147c7499e0016e183d5d56a7b44efe4b (patch)
treec1d1b4a9fdafd92863c0922b05d72c14de83ffa7 /src/core/hle/service/sockets
parentcore: defer cpu shutdown (diff)
downloadyuzu-a9369726147c7499e0016e183d5d56a7b44efe4b.tar
yuzu-a9369726147c7499e0016e183d5d56a7b44efe4b.tar.gz
yuzu-a9369726147c7499e0016e183d5d56a7b44efe4b.tar.bz2
yuzu-a9369726147c7499e0016e183d5d56a7b44efe4b.tar.lz
yuzu-a9369726147c7499e0016e183d5d56a7b44efe4b.tar.xz
yuzu-a9369726147c7499e0016e183d5d56a7b44efe4b.tar.zst
yuzu-a9369726147c7499e0016e183d5d56a7b44efe4b.zip
Diffstat (limited to 'src/core/hle/service/sockets')
-rw-r--r--src/core/hle/service/sockets/bsd.cpp3
-rw-r--r--src/core/hle/service/sockets/sockets.cpp19
-rw-r--r--src/core/hle/service/sockets/sockets.h7
3 files changed, 13 insertions, 16 deletions
diff --git a/src/core/hle/service/sockets/bsd.cpp b/src/core/hle/service/sockets/bsd.cpp
index bdb499268..790e28504 100644
--- a/src/core/hle/service/sockets/bsd.cpp
+++ b/src/core/hle/service/sockets/bsd.cpp
@@ -881,8 +881,7 @@ void BSD::OnProxyPacketReceived(const Network::ProxyPacket& packet) {
}
BSD::BSD(Core::System& system_, const char* name)
- : ServiceFramework{system_, name, ServiceThreadType::CreateNew}, room_network{
- system_.GetRoomNetwork()} {
+ : ServiceFramework{system_, name}, room_network{system_.GetRoomNetwork()} {
// clang-format off
static const FunctionInfo functions[] = {
{0, &BSD::RegisterClient, "RegisterClient"},
diff --git a/src/core/hle/service/sockets/sockets.cpp b/src/core/hle/service/sockets/sockets.cpp
index b191b5cf5..676d24e03 100644
--- a/src/core/hle/service/sockets/sockets.cpp
+++ b/src/core/hle/service/sockets/sockets.cpp
@@ -1,6 +1,7 @@
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
+#include "core/hle/service/server_manager.h"
#include "core/hle/service/sockets/bsd.h"
#include "core/hle/service/sockets/nsd.h"
#include "core/hle/service/sockets/sfdnsres.h"
@@ -8,15 +9,17 @@
namespace Service::Sockets {
-void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system) {
- std::make_shared<BSD>(system, "bsd:s")->InstallAsService(service_manager);
- std::make_shared<BSD>(system, "bsd:u")->InstallAsService(service_manager);
- std::make_shared<BSDCFG>(system)->InstallAsService(service_manager);
+void LoopProcess(Core::System& system) {
+ auto server_manager = std::make_unique<ServerManager>(system);
- std::make_shared<NSD>(system, "nsd:a")->InstallAsService(service_manager);
- std::make_shared<NSD>(system, "nsd:u")->InstallAsService(service_manager);
-
- std::make_shared<SFDNSRES>(system)->InstallAsService(service_manager);
+ server_manager->RegisterNamedService("bsd:s", std::make_shared<BSD>(system, "bsd:s"));
+ server_manager->RegisterNamedService("bsd:u", std::make_shared<BSD>(system, "bsd:u"));
+ server_manager->RegisterNamedService("bsdcfg", std::make_shared<BSDCFG>(system));
+ server_manager->RegisterNamedService("nsd:a", std::make_shared<NSD>(system, "nsd:a"));
+ server_manager->RegisterNamedService("nsd:u", std::make_shared<NSD>(system, "nsd:u"));
+ server_manager->RegisterNamedService("sfdnsres", std::make_shared<SFDNSRES>(system));
+ server_manager->StartAdditionalHostThreads("bsdsocket", 2);
+ ServerManager::RunServer(std::move(server_manager));
}
} // namespace Service::Sockets
diff --git a/src/core/hle/service/sockets/sockets.h b/src/core/hle/service/sockets/sockets.h
index 31b7dad33..c94e80ef6 100644
--- a/src/core/hle/service/sockets/sockets.h
+++ b/src/core/hle/service/sockets/sockets.h
@@ -10,10 +10,6 @@ namespace Core {
class System;
}
-namespace Service::SM {
-class ServiceManager;
-}
-
namespace Service::Sockets {
enum class Errno : u32 {
@@ -98,7 +94,6 @@ struct Linger {
u32 linger;
};
-/// Registers all Sockets services with the specified service manager.
-void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system);
+void LoopProcess(Core::System& system);
} // namespace Service::Sockets