diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-09-02 16:18:16 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-09-03 10:59:19 +0200 |
commit | 26c9b836778cbaf9b9ccb9b92e841d7bd6ea2fdc (patch) | |
tree | 36f589364a3040c46914c1e038e6544bb48e4b7f /src/util.cpp | |
parent | 4be0b082b97062be4df20e9c45dafa577b05b07c (diff) |
Move windows socket init to utility function
Diffstat (limited to 'src/util.cpp')
-rw-r--r-- | src/util.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/util.cpp b/src/util.cpp index a7ec740de8..f50d25e17a 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -794,6 +794,18 @@ void SetupEnvironment() boost::filesystem::path::imbue(loc); } +bool SetupNetworking() +{ +#ifdef WIN32 + // Initialize Windows Sockets + WSADATA wsadata; + int ret = WSAStartup(MAKEWORD(2,2), &wsadata); + if (ret != NO_ERROR || LOBYTE(wsadata.wVersion ) != 2 || HIBYTE(wsadata.wVersion) != 2) + return false; +#endif + return true; +} + void SetThreadPriority(int nPriority) { #ifdef WIN32 |