mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-27 19:45:43 +03:00
82 lines
2.0 KiB
C++
82 lines
2.0 KiB
C++
#ifndef SENDSYSTEM_H
|
||
#define SENDSYSTEM_H
|
||
|
||
#include <QObject>
|
||
#include <QString>
|
||
#include <QtNetwork>
|
||
#include <QMutex>
|
||
|
||
#include <Systems/Parsers/dataparser.h>
|
||
#include <Systems/tools.h>
|
||
#include <Data/Client.h>
|
||
#include <Data/PacketType.h>
|
||
|
||
class DataParser;
|
||
class FileData;
|
||
|
||
class SendSystem : public QObject
|
||
{
|
||
Q_OBJECT
|
||
public:
|
||
explicit SendSystem(QObject* parent = nullptr);
|
||
~SendSystem();
|
||
|
||
void initialize(DataParser* dataParser,QMutex *globalMutex);
|
||
void setClient(Client* client,QTcpSocket *socket);
|
||
|
||
void updateFiles(QList<FileData> fileSendList, QList<FileData> deleteList);
|
||
|
||
private:
|
||
bool waitWrittenData(QString marker, int msec = 500);
|
||
|
||
public slots:
|
||
void slot_BytesWrittenToSocket(qint64 bytes);
|
||
|
||
bool slot_getIsSendingStopped() const;
|
||
void slot_stopSending();
|
||
|
||
void slot_socketClose();
|
||
|
||
void slot_sendVersion();
|
||
|
||
void slot_sendNotify(QString notify);
|
||
void slot_sendPacketType(PacketType packet);
|
||
void slot_sendXmlAnswer(QByteArray array, PacketType packetType = PacketType::TYPE_XMLANSWER);
|
||
|
||
void slot_sendDocs_forQtClient(QString docPath);
|
||
|
||
void slot_sendNeedUpdate(bool flag,quint64 size,quint64 fileCount,quint64 deleteCount);
|
||
|
||
void slot_sendFolderBlock(QString path);
|
||
void slot_sendDeleteBlock(QString path);
|
||
|
||
void slot_sendFileBlock_forGUI(QString path);
|
||
void slot_sendFileBlock_forQtClient(QString path);
|
||
void slot_sendFileBlockByteArray(QByteArray array, PacketType packetType);
|
||
void slot_sendFileBlockWithRename_Hash_forQtClient(QString path,QString newName);
|
||
|
||
signals:
|
||
QByteArray sigSendNotify(QString message);
|
||
|
||
private:
|
||
Client *client;
|
||
QTcpSocket* socket;
|
||
DataParser* dataParser;
|
||
|
||
QMutex *globalMutex; //Не используется (но пока оставлен)
|
||
|
||
char* buffer;
|
||
|
||
TypeClientAutorization type;
|
||
|
||
bool flSendingStopped;
|
||
|
||
bool flWaitWritenToSocket;
|
||
qint64 bytesWritedToSocket;
|
||
|
||
qint64 fileSize;
|
||
int countSend;
|
||
};
|
||
|
||
#endif // SENDSYSTEM_H
|