source: nscp/TCPSocketResponder.h @ 782ac8e

0.4.00.4.10.4.2stable
Last change on this file since 782ac8e was a0528c4, checked in by Michael Medin <michael@…>, 8 years ago

Initial release

  • Property mode set to 100644
File size: 1.2 KB
RevLine 
[a0528c4]1#pragma once
2#include "resource.h"
3#include <Thread.h>
4#include <Mutex.h>
5/**
6 * @ingroup NSClient++
7 * Socket responder class.
8 * This is a background thread that listens to the socket and executes incoming commands.
9 *
10 * @version 1.0
11 * first version
12 *
13 * @date 02-12-2005
14 *
15 * @author mickem
16 *
17 * @par license
18 * This code is absolutely free to use and modify. The code is provided "as is" with
19 * no expressed or implied warranty. The author accepts no liability if it causes
20 * any damage to your computer, causes your pet to fall ill, increases baldness
21 * or makes your car start emitting strange noises when you start it up.
22 * This code has no bugs, just undocumented features!
23 *
24 * @todo This is not very well written and should probably be reworked.
25 *
26 * @bug
27 *
28 */
29class TCPSocketResponder {
30private:
31        MutexHandler mutexHandler;
32        bool running_;
33        SOCKET server;
34
35public:
36        TCPSocketResponder();
37        DWORD threadProc(LPVOID lpParameter);
38        void exitThread(void);
39
40private:
41        bool isRunning(void);
42        void stopRunning(void);
43        void startRunning(void);
44        std::list<std::string> split(char* buffer);
45        std::string parseCommand(char* request);
46};
47
48typedef Thread<TCPSocketResponder> TCPSocketResponderThread; // Thread manager
49
50
Note: See TracBrowser for help on using the repository browser.