40 static void close(_In_ socket_t h)
42 int result = closesocket(h);
44 int werrno = WSAGetLastError();
45 if (result >= 0 || werrno == WSAENOTSOCK)
47 throw std::system_error(werrno, std::system_category(),
"closesocket failed");
49 if (result >= 0 || errno == EBADF)
51 throw std::system_error(errno, std::system_category(),
"closesocket failed");