UPnPsdk 0.1
Universal Plug and Play +, Software Development Kit
 
Loading...
Searching...
No Matches
UPnPsdk::anonymous_namespace{global.cpp}::CWSAStartup Class Reference

Initialize and cleanup Microsoft Windows Sockets. More...

Detailed Description

Initialize and cleanup Microsoft Windows Sockets.

Note
This class is not available for the user and only used on Microsoft Windows.

At least one of the global used constants or variables in this file is used nearly by all compile units. This ensures that this unit is always linked to the library no matter what options are selected. So I use it also for an automatic initialization of the library with no need to call an init function by the user.

Winsock needs to be initialized before using it and it needs to be freed. I do that with a class, following the RAII paradigm. The initialization is automatically done by the constructor when using the library. The class is not available for the user. Multiple initialization doesn't matter. This is managed by the operating system with a counter. It ensures that winsock is initialzed only one time and freed with the last free call.

Definition at line 56 of file global.cpp.

Constructor & Destructor Documentation

◆ CWSAStartup()

UPnPsdk::anonymous_namespace{global.cpp}::CWSAStartup::CWSAStartup ( )
inline

Definition at line 58 of file global.cpp.

◆ ~CWSAStartup()

virtual UPnPsdk::anonymous_namespace{global.cpp}::CWSAStartup::~CWSAStartup ( )
inlinevirtual

Definition at line 101 of file global.cpp.


The documentation for this class was generated from the following file: