Initialize and cleanup Microsoft Windows Sockets. More...
Initialize and cleanup Microsoft Windows Sockets.
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.
|
inline |
Definition at line 58 of file global.cpp.
|
inlinevirtual |
Definition at line 101 of file global.cpp.