From 9e08f24769d66c71bb824a92380da6fb5703bcaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 20 Jul 2020 09:40:56 +0200 Subject: [PATCH] Apply a few lines from "Added UPnP support", removing extra WSA calls. --- Core/HLE/sceNet.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/Core/HLE/sceNet.cpp b/Core/HLE/sceNet.cpp index c890e13df6..2d41e054e0 100644 --- a/Core/HLE/sceNet.cpp +++ b/Core/HLE/sceNet.cpp @@ -239,13 +239,8 @@ void __NetInit() { { PPSSPP_ID = getPPSSPPInstanceNumber(); // This should be called when program started instead of when the game started/reseted } -#ifdef _WIN32 - WSADATA data; - int iResult = WSAStartup(MAKEWORD(2, 2), &data); - if (iResult != NOERROR) { - ERROR_LOG(SCENET, "WSA Failed"); - } -#endif + + net::Init(); InitLocalIP(); INFO_LOG(SCENET, "LocalHost IP will be %s", inet_ntoa(((sockaddr_in*)&localIP)->sin_addr)); //net::Init(); @@ -254,10 +249,8 @@ void __NetInit() { void __NetShutdown() { __ResetInitNetLib(); - //net::Shutdown(); -#ifdef _WIN32 - WSACleanup(); -#endif + + net::Shutdown(); //PPSSPPIDCleanup(); // To make the ID/IP persistent on every reset, we should just let the OS closes all open handles instead of calling PPSSPPIDCleanup() on every reset }