2014-06-26 15:15:04 +00:00
|
|
|
#ifndef JCESSLCLIENT_H
|
|
|
|
#define JCESSLCLIENT_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QSslSocket>
|
|
|
|
#include <QThread>
|
|
|
|
#include <QEventLoop>
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
#include <string>
|
|
|
|
#define milisTimeOut 3500
|
|
|
|
|
|
|
|
class jceSSLClient : QSslSocket
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2014-06-26 15:30:49 +00:00
|
|
|
jceSSLClient();
|
2014-06-26 15:15:04 +00:00
|
|
|
|
|
|
|
bool makeConnect(std::string server,int port);
|
|
|
|
bool isConnected();
|
|
|
|
bool sendData(std::string str);
|
|
|
|
bool recieveData(std::string &str, bool fast);
|
|
|
|
bool makeDiconnect();
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void checkErrors(QAbstractSocket::SocketError);
|
|
|
|
void setConnected();
|
|
|
|
void setEncrypted();
|
|
|
|
void setDisconnected();
|
|
|
|
void readIt();
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
bool flag;
|
|
|
|
QString packet;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // JCESSLCLIENT_H
|