Передача больших файлов xml с задачами кусками

This commit is contained in:
2025-06-24 12:19:25 +03:00
parent 1fde2d4609
commit 08e982177a
8 changed files with 138 additions and 20 deletions

View File

@@ -85,7 +85,28 @@ void SendSystem::sendFileBlock(QString path)
file.close();
countSend = 0;
// socket->waitForBytesWritten(10);
// socket->waitForReadyRead(20);
// socket->waitForReadyRead(20);
}
void SendSystem::sendFileBlockByteArray(QByteArray array, PacketType packetType)
{
qDebug() << "sendFileBlockByteArray thread: " << QThread::currentThreadId();
QDataStream stream(socket);
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
fileSize = array.size();
if(fileSize == 0){
emit sigSendToLogger(Tools::getTime() + " WARNING! Zero size ");
return;
}
stream << packetType; //Отправляем тип блока
stream << fileSize;
stream << array;
}
void SendSystem::sendVersion()