Torc  0.1
torcwebsocketthread.h
Go to the documentation of this file.
1 #ifndef TORCWEBSOCKETTHREAD_H
2 #define TORCWEBSOCKETTHREAD_H
3 
4 // Qt
5 #include <QObject>
6 
7 // Torc
8 #include "torcwebsocket.h"
9 #include "torcrpcrequest.h"
10 
12 {
13  Q_OBJECT
14 
15  public:
16  TorcWebSocketThread (qintptr SocketDescriptor, bool Secure);
17  TorcWebSocketThread (const QHostAddress &Address, quint16 Port, bool Secure,
19  ~TorcWebSocketThread() = default;
20 
21  void Start (void) override;
22  void Finish (void) override;
23  void RemoteRequest (TorcRPCRequest *Request);
24  void CancelRequest (TorcRPCRequest *Request);
25  bool IsSecure (void);
26 
27  signals:
28  void ConnectionEstablished (void);
29  void ConnectionUpgraded (void);
30  void RemoteRequestSignal (TorcRPCRequest *Request);
31  void CancelRequestSignal (TorcRPCRequest *Request);
32 
33  private:
34  static void SetupSSL (void);
35  static bool CreateCerts (const QString &CertFile, const QString &KeyFile);
36 
37  private:
38  TorcWebSocket *m_webSocket;
39  bool m_secure;
40  // incoming
41  qintptr m_socketDescriptor;
42 
43  // outgoing
44  const QHostAddress m_address;
45  quint16 m_port;
47 
48  private:
49  Q_DISABLE_COPY(TorcWebSocketThread)
50 };
51 
52 #endif // TORCWEBSOCKETTHREAD_H
void Finish(void) override
Overlays the Websocket protocol over a QTcpSocket.
Definition: torcwebsocket.h:23
void ConnectionUpgraded(void)
void Start(void) override
TorcWebSocketThread(qintptr SocketDescriptor, bool Secure)
A class encapsulating a Remote Procedure Call.
~TorcWebSocketThread()=default
void ConnectionEstablished(void)
void CancelRequestSignal(TorcRPCRequest *Request)
void CancelRequest(TorcRPCRequest *Request)
Wraps a TorcQThread around a TorcWebsocket.
A Torc specific wrapper around QThread.
Definition: torcqthread.h:7
void RemoteRequest(TorcRPCRequest *Request)
void RemoteRequestSignal(TorcRPCRequest *Request)