MCPcopy Create free account
hub / github.com/MonaSolutions/MonaServer / InitializeNetwork

Method InitializeNetwork

MonaBase/sources/Net.cpp:149–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147static mutex Mutex;
148
149bool Net::InitializeNetwork(Exception& ex) {
150 lock_guard<mutex> lock(Mutex);
151 if (Initialized)
152 return true;
153 WORD version = MAKEWORD(2, 2);
154 WSADATA data;
155 if (WSAStartup(version, &data) != 0) {
156 ex.set(Exception::NETWORK, "Failed to initialize network subsystem");
157 return false;
158 }
159 return Initialized = true;
160}
161
162class NetUninitializer {
163public:

Callers

nothing calls this directly

Calls 1

setMethod · 0.45

Tested by

no test coverage detected