wsamanager 분리
This commit is contained in:
@@ -4,20 +4,7 @@
|
||||
|
||||
namespace Chattr {
|
||||
|
||||
Socket::Socket() {
|
||||
#ifdef _WIN32
|
||||
WSADATA wsa;
|
||||
if (WSAStartup(MAKEWORD(2, 2), &wsa) != 0)
|
||||
log::critical("WSAStartup()");
|
||||
#endif
|
||||
}
|
||||
|
||||
Socket::Socket(int domain, int type, int protocol) {
|
||||
#ifdef _WIN32
|
||||
WSADATA wsa;
|
||||
if (WSAStartup(MAKEWORD(2, 2), &wsa) != 0)
|
||||
log::critical("WSAStartup()");
|
||||
#endif
|
||||
init(domain, type, protocol);
|
||||
}
|
||||
|
||||
@@ -42,8 +29,7 @@ void Socket::destruct() {
|
||||
if (!valid_)
|
||||
return;
|
||||
#ifdef _WIN32
|
||||
closesocket(sock_);
|
||||
WSACleanup();
|
||||
::closesocket(sock_);
|
||||
#elif __linux__
|
||||
::close(sock_);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user