last changes

This commit is contained in:
2020-06-15 22:22:46 +03:00
parent 5f405ca403
commit 259f321df4
53 changed files with 3368 additions and 842 deletions

37
AdServer/server.h Normal file
View File

@@ -0,0 +1,37 @@
#ifndef SERVER_H
#define SERVER_H
#include <QObject>
#include <QTcpServer>
#include <QNetworkInterface>
#include <QStringList>
#include "connection.h"
class Server : public QObject
{
Q_OBJECT
public:
explicit Server(QObject *parent = 0);
QStringList getIpList();
void startServer(QHostAddress);
void stopServer();
QString getStatus();
void send(const QByteArray &ba);
private:
QTcpServer * m_server;
QList <Connection*> clients;
int next_conn_id;
private slots:
void newConnection();
void connectionClosed();
void received(QByteArray ba);
signals:
void receiveData(QByteArray ba);
};
#endif // SERVER_H