mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
sendFileBlock_V3
This commit is contained in:
@@ -14,14 +14,15 @@ ClientHandler::ClientHandler( QObject *parent):
|
||||
void ClientHandler::initialize(int descriptor,
|
||||
UpdateController *updateController,DataParser *dataParser, QMutex *mutex)
|
||||
{
|
||||
this->socket = new QTcpSocket;
|
||||
this->thread = new QThread;
|
||||
qDebug() << "ClientHandler::initialize thread ID " << QThread::currentThreadId();
|
||||
|
||||
socket = new QTcpSocket;
|
||||
thread = new QThread;
|
||||
|
||||
QIODevice::OpenMode openMode = socket->openMode();
|
||||
socket->setParent(nullptr);
|
||||
socket->setSocketDescriptor(descriptor);
|
||||
|
||||
qDebug() << "ClientHandler::initialize thread ID " << QThread::currentThreadId();
|
||||
|
||||
sendSystem = new SendSystem;
|
||||
recognizeSystem = new RecognizeSystem;
|
||||
|
||||
@@ -42,7 +43,7 @@ void ClientHandler::initialize(int descriptor,
|
||||
connect(recognizeSystem,&RecognizeSystem::signal_updateDocsXML,this,&ClientHandler::signal_updateDocsXML);
|
||||
|
||||
connect(this,&ClientHandler::sigSendXmlAnswer,sendSystem,&SendSystem::sendXmlAnswer,Qt::AutoConnection);
|
||||
connect(this,&ClientHandler::sigInitSender,sendSystem,&SendSystem::initialize,Qt::AutoConnection/*Qt::DirectConnection*/);
|
||||
//connect(this,&ClientHandler::sigInitSender,sendSystem,&SendSystem::initialize,Qt::AutoConnection/*Qt::DirectConnection*/);
|
||||
connect(this,&ClientHandler::sigFileBlock,sendSystem,&SendSystem::sendFileBlock,Qt::AutoConnection);
|
||||
connect(this,&ClientHandler::sigFileBlockByteArray,sendSystem,&SendSystem::sendFileBlockByteArray,Qt::AutoConnection);
|
||||
connect(this,&ClientHandler::sigFolderBlock,sendSystem,&SendSystem::sendFolderBlock,Qt::AutoConnection);
|
||||
@@ -60,9 +61,10 @@ void ClientHandler::initialize(int descriptor,
|
||||
connect(socket,&QTcpSocket::readyRead,this,&ClientHandler::initClientType,Qt::AutoConnection);
|
||||
initClientType();
|
||||
|
||||
recognizeSystem->initialize(updateController,dataParser,sendSystem, this);
|
||||
recognizeSystem->initialize(updateController,dataParser, mutex,sendSystem, this);
|
||||
sendSystem->setClient(client,socket);
|
||||
emit sigInitSender(dataParser, mutex);
|
||||
sendSystem->initialize(dataParser, mutex);
|
||||
//emit sigInitSender(dataParser, mutex);
|
||||
|
||||
Logger::instance().log("SERVER: Client connected");
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
|
||||
signals:
|
||||
void sigSendXmlAnswer(QByteArray array, PacketType packetType);
|
||||
void sigInitSender (DataParser *dataParse, QMutex *mutex);
|
||||
//void sigInitSender (DataParser *dataParse, QMutex *mutex);
|
||||
void sigFolderBlock(QString path);
|
||||
void sigFileBlock(QString path);
|
||||
void sigFileBlockByteArray(QByteArray array, PacketType packetType);
|
||||
@@ -71,6 +71,10 @@ signals:
|
||||
|
||||
void signal_updateDocsXML();
|
||||
|
||||
private:
|
||||
void initClientType();
|
||||
void packetTypeInit(PacketType packet, Client *client);
|
||||
|
||||
public :
|
||||
QThread *thread;
|
||||
QTcpSocket *socket;
|
||||
@@ -82,11 +86,7 @@ private:
|
||||
UpdateController *updateController;
|
||||
RecognizeSystem *recognizeSystem;
|
||||
Client *client;
|
||||
|
||||
SendSystem *sendSystem;
|
||||
|
||||
void initClientType();
|
||||
void packetTypeInit(PacketType packet, Client *client);
|
||||
SendSystem *sendSystem;
|
||||
};
|
||||
|
||||
#endif // CLIENTHANDLER_H
|
||||
|
||||
Reference in New Issue
Block a user