Rudiments: /home/dmuse/temp/rudiments/include/rudiments/private/winsock.h Source File

Rudiments

winsock.h
1 // Copyright (c) 1999-2018 David Muse
2 // See the COPYING file for more information.
3
4 #ifndef RUDIMENTS_WINSOCK_H
5 #define RUDIMENTS_WINSOCK_H
6
7 #include <rudiments/private/config.h>
8
9 #ifdef RUDIMENTS_HAVE_WINSOCK2_H
10 #include <rudiments/threadmutex.h>
11 #include <winsock2.h>
12 #endif
13
14 // must be included after winsock2.h
15 #ifdef RUDIMENTS_HAVE_WINDOWS_H
16 #include <windows.h>
17 #endif
18
19 class winsock {
20 public:
21 static bool initWinsock();
22 static void shutDownWinsock();
23 private:
24 #ifdef RUDIMENTS_HAVE_WINSOCK2_H
25 static bool _initialized;
26 static threadmutex _winsockmutex;
27 static WSADATA _wsadata;
28 #endif
29 };
30
31 #endif
threadmutex
Definition: threadmutex.h:11
winsock
Definition: winsock.h:19