diff --git a/Source/Core/Common/Network.cpp b/Source/Core/Common/Network.cpp index a112fb9a99..0346fe427d 100644 --- a/Source/Core/Common/Network.cpp +++ b/Source/Core/Common/Network.cpp @@ -566,4 +566,14 @@ const char* DecodeNetworkError(s32 error_code) return strerror_r(error_code, buffer, sizeof(buffer)); #endif } + +const char* StrNetworkError() +{ +#ifdef _WIN32 + const s32 error_code = WSAGetLastError(); +#else + const s32 error_code = errno; +#endif + return DecodeNetworkError(error_code); +} } // namespace Common diff --git a/Source/Core/Common/Network.h b/Source/Core/Common/Network.h index c615d31451..64958a5175 100644 --- a/Source/Core/Common/Network.h +++ b/Source/Core/Common/Network.h @@ -266,4 +266,5 @@ u16 ComputeTCPNetworkChecksum(const IPAddress& from, const IPAddress& to, const NetworkErrorState SaveNetworkErrorState(); void RestoreNetworkErrorState(const NetworkErrorState& state); const char* DecodeNetworkError(s32 error_code); +const char* StrNetworkError(); } // namespace Common