Files
NP_Midterm/include/Socket/WSAManager.hpp

24 lines
301 B
C++

#pragma once
#include "precomp.hpp"
#include "Socket/Log.hpp"
namespace Chattr {
struct WSAManager {
WSAManager() {
#ifdef _WIN32
WSADATA wsa;
if (WSAStartup(MAKEWORD(2, 2), &wsa) != 0)
log::critical("WSAStartup()");
#endif
}
~WSAManager() {
#ifdef _WIN32
WSACleanup();
#endif
}
};
}