forked from vranki/ExtPlane
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtcpserver.h
More file actions
33 lines (29 loc) · 705 Bytes
/
tcpserver.h
File metadata and controls
33 lines (29 loc) · 705 Bytes
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
#ifndef TCPSERVER_H
#define TCPSERVER_H
#include <QObject>
#include <QTcpServer>
#include <QTcpSocket>
#include <QList>
#include "datarefs/dataref.h"
/**
* Creates the TCP socket and manages client connections
*/
#define EXTPLANE_PORT 51000
class TcpClient;
class DataRefProvider;
class TcpServer : public QObject {
Q_OBJECT
public:
TcpServer(QObject *parent, DataRefProvider *refProvider);
~TcpServer();
signals:
void setFlightLoopInterval(float newInterval);
public slots:
void clientConnected();
void clientDiscoed(TcpClient *client);
private:
QTcpServer server;
QList<TcpClient *> clientConnections;
DataRefProvider *_refProvider;
};
#endif // TCPSERVER_H