初步完成文件夹传输。
This commit is contained in:
@@ -15,8 +15,14 @@
|
||||
#include <QReadWriteLock>
|
||||
#include <QTcpSocket>
|
||||
#include <QThread>
|
||||
#include <QTimer>
|
||||
#include <array>
|
||||
|
||||
class WaitOperOwn;
|
||||
struct WaitTask {
|
||||
QString id;
|
||||
WaitOperOwn* wo;
|
||||
};
|
||||
class ClientCore : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -93,6 +99,7 @@ private:
|
||||
void onReadyRead();
|
||||
void onDisconnected();
|
||||
void handleAsk(QSharedPointer<FrameBuffer> frame);
|
||||
void clearWaitTask();
|
||||
|
||||
private:
|
||||
void UseFrame(QSharedPointer<FrameBuffer> frame);
|
||||
@@ -121,6 +128,10 @@ public:
|
||||
|
||||
bool connected_{false};
|
||||
LocalFile localFile_;
|
||||
|
||||
QTimer* clearWaitTimer_{};
|
||||
QMutex waitTaskMut_;
|
||||
QMap<QString, WaitTask> waitTask_;
|
||||
};
|
||||
|
||||
// 工作线程。
|
||||
@@ -194,7 +205,8 @@ public:
|
||||
void run() override;
|
||||
void SetType(const QString& sendType, const QString& ansType);
|
||||
void SetPath(const QString& stra, const QString& strb, const QString& type);
|
||||
InfoMsg GetMsg() const;
|
||||
InfoMsg GetMsgConst() const;
|
||||
InfoMsg& GetMsgRef();
|
||||
void interrupCheck() override;
|
||||
void recvFrame(QSharedPointer<FrameBuffer> frame) override;
|
||||
|
||||
@@ -224,8 +236,9 @@ public:
|
||||
void recvFrame(QSharedPointer<FrameBuffer> frame) override;
|
||||
|
||||
public:
|
||||
QString fid;
|
||||
InfoMsg infoMsg_{};
|
||||
std::function<void()> func_;
|
||||
std::function<bool()> func_;
|
||||
};
|
||||
|
||||
#endif // CLIENTCORE_H
|
||||
Reference in New Issue
Block a user