mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
refract Server 0
This commit is contained in:
@@ -1,27 +1,26 @@
|
||||
#ifndef MULTITHREADSERVER_H
|
||||
#define MULTITHREADSERVER_H
|
||||
|
||||
#include "serverlmswidget.h"
|
||||
#include "Systems/processingsystem.h"
|
||||
#include <QObject>
|
||||
|
||||
class ProcessingSystem;
|
||||
class DocsUpdater;
|
||||
class MultiThreadServer : public QTcpServer
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MultiThreadServer(ServerLMSWidget *widget,UpdateController *updateController,ProcessingSystem *processingSystem,
|
||||
MultiThreadServer(UpdateController *updateController, DocsUpdater *docsUpdater,ProcessingSystem *processingSystem,
|
||||
DataParser *dataParser, qint16 hostPort, QObject *parent = nullptr);
|
||||
~MultiThreadServer();
|
||||
|
||||
|
||||
QMap<int, ClientHandler *> *getClientsMap() const;
|
||||
QStringList getClientFullNameList();
|
||||
void updateClientList();
|
||||
void disableClients();
|
||||
|
||||
bool startServer();
|
||||
bool stopServer();
|
||||
|
||||
EStateBlockAutorization getStateBlockAutorization() const
|
||||
{
|
||||
return stateBlockAutorization;
|
||||
@@ -30,38 +29,60 @@ public:
|
||||
{
|
||||
return stateServer;
|
||||
}
|
||||
QMutex *getMutex() const
|
||||
{
|
||||
return mutex;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
bool startServer();
|
||||
bool stopServer();
|
||||
|
||||
void blockAutorization()
|
||||
{
|
||||
stateBlockAutorization = blocked;
|
||||
emit signal_StateServer(stateServer, stateBlockAutorization);
|
||||
}
|
||||
void unBlockAutorization()
|
||||
{
|
||||
stateBlockAutorization = unblocked;
|
||||
emit signal_StateServer(stateServer, stateBlockAutorization);
|
||||
}
|
||||
|
||||
signals:
|
||||
void sigInitClient(int descriptor, ServerLMSWidget *serverWidget,
|
||||
UpdateController *updateController, DataParser *dataParser);
|
||||
//void sigInitClient(int descriptor, ServerLMSWidget *serverWidget,
|
||||
// UpdateController *updateController, DataParser *dataParser, QMutex *mutex);
|
||||
void signalStopSendFile();
|
||||
|
||||
void signal_BlockAutorizationIndicate(bool block, QString blocker, QString types);
|
||||
void signal_sendPacketToAllClients(PacketType packetType, bool flOnlyGUI);
|
||||
|
||||
void signal_StateServer(EStateServer stateServer, EStateBlockAutorization stateBlockAutorization);
|
||||
|
||||
void signal_UpdateListClients(QStringList listFullName);
|
||||
|
||||
void signal_updateDocsXML();
|
||||
|
||||
public slots:
|
||||
void slotDisconnectClient(QString peerAddress, QString peerPort);
|
||||
|
||||
bool slot_BlockAutorization(bool block, QString whoFullName, QString type);
|
||||
|
||||
void slot_StartServer();
|
||||
void slot_StopServer();
|
||||
|
||||
void slot_UpdateDocs();
|
||||
protected:
|
||||
void incomingConnection(qintptr handle) override;
|
||||
|
||||
private:
|
||||
ServerLMSWidget *serverLmsWidget;
|
||||
QMutex *mutex;
|
||||
QMap<int, ClientHandler*> *clientsMap;
|
||||
qint16 hostPort;
|
||||
ProcessingSystem *processingSystem;
|
||||
UpdateController *updateController;
|
||||
DocsUpdater *docsUpdater;
|
||||
DataParser *dataParser;
|
||||
|
||||
EStateServer stateServer;
|
||||
|
||||
Reference in New Issue
Block a user