From 9dd6d2de10ff8811c19169069f3f1e12e1987dae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 19 Oct 2026 14:13:42 +0200 Subject: [PATCH] Headless: Always initialize networking Without WSAStartup, every sceNetInet socket call failed on Windows with WSANOTINITIALISED, so no inet test could run there. Co-Authored-By: Claude Opus 5.5 (1M context) --- headless/Headless.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/headless/Headless.cpp b/headless/Headless.cpp index 317503e890..85c028e454 100644 --- a/headless/Headless.cpp +++ b/headless/Headless.cpp @@ -840,11 +840,9 @@ int main(int argc, const char* argv[]) { return 0; } - // Needed before any sockets can be used (WSAStartup on Windows) - without this, the - // WebSocket debugger silently fails to listen. Only done when requested since headless - // otherwise has no use for networking. - if (cmdLineOptions.DebuggerPort().has_value()) - net::Init(); + // Needed before any sockets can be used (WSAStartup on Windows), by the WebSocket debugger + // and by tests and games that use sceNetInet. + net::Init(); AutoTestOptions testOptions{}; testOptions.compare = cmdLineOptions.compare.value_or(false); @@ -1447,9 +1445,7 @@ int main(int argc, const char* argv[]) { g_VFS.Clear(); g_logManager.Shutdown(); - if (cmdLineOptions.DebuggerPort().has_value()) { - net::Shutdown(); - } + net::Shutdown(); TimeShutdown(); g_threadManager.Teardown();