jce-manager/src/jceConnection/jcesslclient.h

43 lines
838 B
C
Raw Normal View History

2014-09-08 15:54:52 +00:00
#ifndef JCESSLCLIENT_H
#define JCESSLCLIENT_H
#include <QObject>
#include <QSslSocket>
#include <QThread>
#include <QEventLoop>
#include <QMessageBox>
2014-09-08 15:54:52 +00:00
#include <iostream>
#include <string>
#define milisTimeOut 3500
class jceSSLClient : QSslSocket
{
Q_OBJECT
public:
jceSSLClient();
bool makeConnect(QString server, int port);
2014-09-08 15:54:52 +00:00
bool isConnected();
bool sendData(QString str);
bool recieveData(QString &str, bool fast);
2014-09-08 15:54:52 +00:00
bool makeDiconnect();
void showIfErrorMsg();
2014-09-08 15:54:52 +00:00
private slots:
void checkErrors(QAbstractSocket::SocketError a);
2014-09-08 15:54:52 +00:00
void setConnected();
void setEncrypted();
void setDisconnected();
void readIt();
private:
bool flag;
QString packet;
QEventLoop loop; //handle the connection as thread
2014-09-08 15:54:52 +00:00
};
#endif // JCESSLCLIENT_H