XX CMake Package
Loading...
Searching...
No Matches
XXSecureNetworkSocket.h
Go to the documentation of this file.
1#ifndef XXSecureNetworkSocketH
2#define XXSecureNetworkSocketH
3
5#include <QObject>
6
7#include <QPointer>
8
9#include <QSslError>
10#include <QSslSocket>
11
12namespace XX
13{
14 namespace SecureNetwork
15 {
18
19 class XXNETWORK_DECLSPEC Socket : public QObject
20 {
21 Q_OBJECT
22 public:
23 using Pointer = QPointer<Socket>;
24
25 signals:
26 void signalDataReceived(Socket* me, const QByteArray& data);
30
31 public:
32 void sendData(const QByteArray& data);
33 QSslCertificate getPeerCertificate() const;
34 operator QSslSocket*() const;
35
36 public:
37 static bool verbose;
38
39 protected:
40 Socket(QObject* parent, QSslSocket* externalSocket = nullptr, bool directAccess = false);
41 virtual ~Socket();
42
43 protected:
44 QPointer<QSslSocket> sslSocket;
46
47 private:
48 friend class Server;
49 friend class ServerInternal;
50
51 private slots:
52 // socket
53 void slotReadyRead();
54 void slotConnected();
55 void slotDisconnected();
56 void slotEncypted();
57 void slotErrorOccurred(QAbstractSocket::SocketError socketError);
58 void slotStateChanged(QAbstractSocket::SocketState socketState);
59 void slotSslErrors(const QList<QSslError>&);
60 // ssl
61 void slotPeerVerifyError(const QSslError& error);
62 };
63 } // namespace SecureNetwork
64} // namespace XX
65
66#endif // NOT XXSecureNetworkSocketH
#define XXNETWORK_DECLSPEC
Definition XXNetworkExportDef.h:11
QPointer< QSslSocket > sslSocket
Definition XXSecureNetworkSocket.h:44
void signalConnected(Socket *me)
QPointer< Socket > Pointer
Definition XXSecureNetworkSocket.h:23
bool directAccess
Definition XXSecureNetworkSocket.h:45
QSslCertificate getPeerCertificate() const
void signalDisconnected(Socket *me)
static bool verbose
Definition XXSecureNetworkSocket.h:37
void signalEncrypted(Socket *me)
void signalDataReceived(Socket *me, const QByteArray &data)
void sendData(const QByteArray &data)
friend class Server
Definition XXSecureNetworkSocket.h:48
friend class ServerInternal
Definition XXSecureNetworkSocket.h:49
Socket(QObject *parent, QSslSocket *externalSocket=nullptr, bool directAccess=false)
Definition XXSecureNetworkServerInternal.h:11
Definition XXPopulatedAbstract.h:11