OpenCOVER
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EventReceiver.h
Go to the documentation of this file.
1 /* This file is part of COVISE.
2 
3  You can use it under the terms of the GNU Lesser General Public License
4  version 2.1 or later, see lgpl-2.1.txt.
5 
6  * License: LGPL 2+ */
7 
8 #ifndef _EVENT_RECEIVER_H
9 #define _EVENT_RECEIVER_H
10 
11 // winsock2.h must be included before windows.h
12 #ifdef _WIN32
13 #include <winsock2.h>
14 #endif
15 
16 namespace opencover
17 {
18 
20 {
21 public:
22  EventReceiver(int port, int window);
23  virtual ~EventReceiver();
24 
25 private:
26  void _mainLoop();
27  void _readData();
28 #ifdef _WIN32
29  static void _receiveLoop(void *);
30 #else
31  static void *_receiveLoop(void *);
32 #endif
33 
34  void _createSocket();
35  void _disconnectSocket();
36 
37  int _port;
38  int _windowID;
39 #ifdef _WIN32
40  SOCKET _socket;
41 #else
42  int _socket;
43 #endif
44 };
45 }
46 #endif
Definition: EventReceiver.h:19
EventReceiver(int port, int window)