-
Notifications
You must be signed in to change notification settings - Fork 0
/
sslclient.h
51 lines (40 loc) · 1.07 KB
/
sslclient.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
41
42
43
44
45
46
47
48
49
50
51
#ifndef CLIENT_H
#define CLIENT_H
#include <QSslSocket>
#include <QFileInfoList>
#include <QWidget>
QT_BEGIN_NAMESPACE
class QsslSocket;
class QNetworkSession;
QT_END_NAMESPACE
class Client : public QWidget
{
Q_OBJECT
public:
Client(QWidget *parent = 0);
void makeConnection(QString ip, int port, QString password);
void sendFINDrequest(QString regexpr);
void sendGETrequest(QString peer, QString file);
private slots:
void discon();
void readFortune();
void displayError(QAbstractSocket::SocketError);
signals:
void gotReject(QString error);
void gotResponse(QString);
void clientError(QString);
private:
void processRequest(const QFileInfoList & );
void loadPfxCertifcate(QString certPath, QString passphrase);
void sendFile(QString fileName);
void receiveFile();
QFile *FileForSend;
QFile *receivedFile;
qint64 sizeReceivedData;
QString shareRoot;
QSslSocket sslSocket;
QString currentDownload;
quint64 blockSize;
bool isRAW;
};
#endif