3#ifndef TIME_SHIELD_HEADER_NTP_DETAIL_WSA_GUARD_HPP_INCLUDED
4#define TIME_SHIELD_HEADER_NTP_DETAIL_WSA_GUARD_HPP_INCLUDED
10#if TIME_SHIELD_HAS_WINSOCK
11# ifndef WIN32_LEAN_AND_MEAN
12# define WIN32_LEAN_AND_MEAN
21# error "WsaGuard requires WinSock support"
49 const WSADATA&
data() const noexcept {
Singleton guard for WinSock initialization.
WsaGuard & operator=(const WsaGuard &)=delete
const WSADATA & data() const noexcept
Returns the WSAData structure (valid only if successful).
int ret_code() const noexcept
Returns the result code from WSAStartup.
static const WsaGuard & instance()
Returns the singleton instance, initializing WSA if needed.
bool success() const noexcept
Returns whether WSAStartup was successful.
WsaGuard(const WsaGuard &)=delete
Main namespace for the Time Shield library.