This commit is contained in:
2025-12-05 12:20:47 +03:00
parent 57673d0ee4
commit 05fce073f1
450 changed files with 58 additions and 58 deletions

View File

@@ -0,0 +1,65 @@
#ifndef MULTITHREADSERVER_H
#define MULTITHREADSERVER_H
#include "serverlmswidget.h"
#include "Systems/processingsystem.h"
#include <QObject>
class ProcessingSystem;
class MultiThreadServer : public QTcpServer
{
Q_OBJECT
public:
MultiThreadServer(ServerLMSWidget *widget,UpdateController *updateController,ProcessingSystem *processingSystem,
DataParser *dataParser, qint16 hostPort, QObject *parent = nullptr);
QMap<int, ClientHandler *> *getClientsMap() const;
void updateClientList();
void disableClients();
bool startServer();
bool stopServer();
void blockAutorization()
{
stateBlockAutorization = blocked;
}
void unBlockAutorization()
{
stateBlockAutorization = unblocked;
}
EStateBlockAutorization getStateBlockAutorization() const
{
return stateBlockAutorization;
}
EStateServer getStateServer()
{
return stateServer;
}
signals:
void sigInitClient(int descriptor, ServerLMSWidget *serverWidget,
UpdateController *updateController, DataParser *dataParser);
void signalStopSendFile();
public slots:
void slotDisconnectClient(QString peerAddress, QString peerPort);
protected:
void incomingConnection(qintptr handle) override;
private:
ServerLMSWidget *serverLmsWidget;
QMap<int, ClientHandler*> *clientsMap;
qint16 hostPort;
ProcessingSystem *processingSystem;
UpdateController *updateController;
DataParser *dataParser;
EStateServer stateServer;
EStateBlockAutorization stateBlockAutorization;
void removeClient(int idSocket);
void addClient(qintptr descriptor, ClientHandler *client);
};
#endif // MULTITHREADSERVER_H