diff options
author | orivej <orivej@yandex-team.ru> | 2022-02-10 16:45:01 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:01 +0300 |
commit | 2d37894b1b037cf24231090eda8589bbb44fb6fc (patch) | |
tree | be835aa92c6248212e705f25388ebafcf84bc7a1 /contrib/libs/poco/Net/src/Net.cpp | |
parent | 718c552901d703c502ccbefdfc3c9028d608b947 (diff) | |
download | ydb-2d37894b1b037cf24231090eda8589bbb44fb6fc.tar.gz |
Restoring authorship annotation for <orivej@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/poco/Net/src/Net.cpp')
-rw-r--r-- | contrib/libs/poco/Net/src/Net.cpp | 152 |
1 files changed, 76 insertions, 76 deletions
diff --git a/contrib/libs/poco/Net/src/Net.cpp b/contrib/libs/poco/Net/src/Net.cpp index 5365f19b10..e81b4b5459 100644 --- a/contrib/libs/poco/Net/src/Net.cpp +++ b/contrib/libs/poco/Net/src/Net.cpp @@ -1,76 +1,76 @@ -// -// Net.cpp -// -// Library: Net -// Package: NetCore -// Module: NetCore -// -// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/Net/Net.h" - - -#include "Poco/Net/SocketDefs.h" -#include "Poco/Net/NetException.h" - - -namespace Poco { -namespace Net { - - -void Net_API initializeNetwork() -{ -#if defined(POCO_OS_FAMILY_WINDOWS) - WORD version = MAKEWORD(2, 2); - WSADATA data; - if (WSAStartup(version, &data) != 0) - throw NetException("Failed to initialize network subsystem"); -#endif -} - - -void Net_API uninitializeNetwork() -{ -#if defined(POCO_OS_FAMILY_WINDOWS) - WSACleanup(); -#endif -} - - -} } // namespace Poco::Net - - -#if defined(POCO_OS_FAMILY_WINDOWS) && !defined(POCO_NO_AUTOMATIC_LIB_INIT) - - struct NetworkInitializer - /// Network initializer for windows statically - /// linked library. - { - NetworkInitializer() - /// Calls Poco::Net::initializeNetwork(); - { - Poco::Net::initializeNetwork(); - } - - ~NetworkInitializer() - /// Calls Poco::Net::uninitializeNetwork(); - { - try - { - Poco::Net::uninitializeNetwork(); - } - catch (...) - { - poco_unexpected(); - } - } - }; - - const NetworkInitializer pocoNetworkInitializer; - -#endif +// +// Net.cpp +// +// Library: Net +// Package: NetCore +// Module: NetCore +// +// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#include "Poco/Net/Net.h" + + +#include "Poco/Net/SocketDefs.h" +#include "Poco/Net/NetException.h" + + +namespace Poco { +namespace Net { + + +void Net_API initializeNetwork() +{ +#if defined(POCO_OS_FAMILY_WINDOWS) + WORD version = MAKEWORD(2, 2); + WSADATA data; + if (WSAStartup(version, &data) != 0) + throw NetException("Failed to initialize network subsystem"); +#endif +} + + +void Net_API uninitializeNetwork() +{ +#if defined(POCO_OS_FAMILY_WINDOWS) + WSACleanup(); +#endif +} + + +} } // namespace Poco::Net + + +#if defined(POCO_OS_FAMILY_WINDOWS) && !defined(POCO_NO_AUTOMATIC_LIB_INIT) + + struct NetworkInitializer + /// Network initializer for windows statically + /// linked library. + { + NetworkInitializer() + /// Calls Poco::Net::initializeNetwork(); + { + Poco::Net::initializeNetwork(); + } + + ~NetworkInitializer() + /// Calls Poco::Net::uninitializeNetwork(); + { + try + { + Poco::Net::uninitializeNetwork(); + } + catch (...) + { + poco_unexpected(); + } + } + }; + + const NetworkInitializer pocoNetworkInitializer; + +#endif |