forked from cculianu/SpikeGL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCommandServer.h
47 lines (35 loc) · 1.03 KB
/
CommandServer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* CommandServer.h
* SpikeGL
*
* Created by calin on 5/18/10.
* Copyright 2010 Calin Culianu <[email protected]>. All rights reserved.
*
*/
#ifndef COMMAND_SERVER_H
#define COMMAND_SERVER_H
#define DEFAULT_COMMAND_PORT 4142 /**< the port of the 'command' server */
#define DEFAULT_COMMAND_TIMEOUT_MS 10000
#include <QObject>
#include <QTcpServer>
#include <QEvent>
#include <QString>
class MainApp;
class CommandConnection;
class CommandServer : protected QTcpServer {
public:
CommandServer(MainApp *parentApp);
~CommandServer();
bool beginListening(const QString & iface = "0.0.0.0", unsigned short port = DEFAULT_COMMAND_PORT, unsigned timeout_ms = DEFAULT_COMMAND_TIMEOUT_MS);
protected:
#if QT_VERSION >= 0x050000
void incomingConnection (qintptr socketDescr); ///< reimplemented from QTcpServer
#else
void incomingConnection (int socketDescr); ///< reimplemented from QTcpServer
#endif
public:
static void deleteAllActiveConnections();
private:
int timeout_msecs;
};
#endif