wsamanager 분리
This commit is contained in:
@@ -6,7 +6,7 @@ namespace Chattr {
|
||||
|
||||
class Socket {
|
||||
public:
|
||||
Socket();
|
||||
Socket() = default;
|
||||
Socket(int domain, int type, int protocol);
|
||||
~Socket();
|
||||
|
||||
|
||||
21
include/Socket/WSAManager.hpp
Normal file
21
include/Socket/WSAManager.hpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
#include "precomp.hpp"
|
||||
#include "Socket/Log.hpp"
|
||||
|
||||
#ifdef _WIN32
|
||||
namespace Chattr {
|
||||
struct WSAManager {
|
||||
|
||||
WSAManager() {
|
||||
WSADATA wsa;
|
||||
if (WSAStartup(MAKEWORD(2, 2), &wsa) != 0)
|
||||
log::critical("WSAStartup()");
|
||||
}
|
||||
|
||||
~WSAManager() {
|
||||
WSACleanup();
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user