1 Star 0 Fork 16

黄新宇/qipmsg

forked from caowai/qipmsg 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
ipmsgfileserver.h 1.10 KB
一键复制 编辑 原始数据 按行查看 历史
caowai 提交于 2019-01-09 21:18 . Add receive file support by 201901109
#ifndef IPMSGFILESERVER_H
#define IPMSGFILESERVER_H
#include <QObject>
#include <QHostAddress>
#include <QFileInfo>
#include <QTcpServer>
#include <QTcpSocket>
#include "ipmsgcommon.h"
class IpMsgFileServer : public QObject
{
Q_OBJECT
public:
explicit IpMsgFileServer(QObject *parent = nullptr);
QTcpSocket* fileServerSockMatch(quint32 host, quint16 port);
bool mFileServerListen = false;
signals:
void ipMsgFileServerDataReady(quint32 ip,quint16 port,QByteArray data);
void ipMsgFileServerSendFileFinished(quint32 fileId);
void fileSeverFilerTransProgress(quint32 fileId,int val); // 进度信号,[0, 100],指示进度
void fileServerFileTransFinished(quint32 fileId); // 结束信号
void fileServerTransFinished();
public slots:
void fileServerNewConnection();
void fileServerReadyRead();
void fileServerSockDisconnect();
void fileServerSockError(QAbstractSocket::SocketError error);
private:
QTcpServer mServer;
QList <fileEntryT *> fileSendQueue;
QList <QTcpSocket *> mSocks;
QThread *mSendThread = nullptr;
};
#endif // IPMSGFILESERVER_H
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/flydilong/qipmsg.git
[email protected]:flydilong/qipmsg.git
flydilong
qipmsg
qipmsg
master

搜索帮助