mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
62 lines
1.6 KiB
C++
62 lines
1.6 KiB
C++
#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;
|
|
}
|
|
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
|