-
Notifications
You must be signed in to change notification settings - Fork 1
/
tcpclient.h
40 lines (34 loc) · 1.01 KB
/
tcpclient.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef TCPCLIENT_H
#define TCPCLIENT_H
#include <QObject>
#include <QTcpSocket>
#include <QHostAddress>
#include <QList>
#include <QFile>
#include <QDataStream>
class tcpclient : public QObject
{
Q_OBJECT
public:
explicit tcpclient(QFile *file,QTcpSocket *socket,QHostAddress addr,QObject *parent = 0);
QString getaddr() const;
private:
qint64 totalBytes_; //总共数据大小
qint64 bytesToWrite_; //还剩数据大小
qint64 bytesWritten_; //已发送数据大小
qint64 loadSize_; //缓冲区大小
QString filename_;
QByteArray outBlock; //数据缓冲区,即存放每次要发送的数据
QFile *localfile_;
QTcpSocket *clientsock;
QHostAddress addr;
int row;
signals:
void finishsend(QString addr);
void error(QString addr);
public slots:
private slots:
void filedatasend(qint64 numByte);
void msgrev();
};
#endif // TCPCLIENT_H