mirror of
https://github.com/pocoproject/poco.git
synced 2025-02-21 06:37:42 +01:00
port of 1.4.4 rev. 19278 (fixed SF# 3475050)
This commit is contained in:
parent
2a6d58c7f2
commit
91b3ca4421
@ -271,21 +271,13 @@ void DNS::aierror(int code, const std::string& arg)
|
||||
}
|
||||
|
||||
|
||||
#if defined(_WIN32)
|
||||
static Poco::AtomicCounter initializeCount;
|
||||
#endif
|
||||
|
||||
|
||||
void initializeNetwork()
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
if (++initializeCount == 1)
|
||||
{
|
||||
WORD version = MAKEWORD(2, 2);
|
||||
WSADATA data;
|
||||
if (WSAStartup(version, &data) != 0)
|
||||
throw NetException("Failed to initialize network subsystem");
|
||||
}
|
||||
WORD version = MAKEWORD(2, 2);
|
||||
WSADATA data;
|
||||
if (WSAStartup(version, &data) != 0)
|
||||
throw NetException("Failed to initialize network subsystem");
|
||||
#endif // _WIN32
|
||||
}
|
||||
|
||||
@ -293,10 +285,7 @@ void initializeNetwork()
|
||||
void uninitializeNetwork()
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
if (--initializeCount == 0)
|
||||
{
|
||||
WSACleanup();
|
||||
}
|
||||
WSACleanup();
|
||||
#endif // _WIN32
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user