1 #ifndef TORCWEBSOCKET_H 2 #define TORCWEBSOCKET_H 9 #include <QHostAddress> 20 #define HTTP_SOCKET_TIMEOUT 30000 // 30 seconds of inactivity 21 #define FULL_SOCKET_TIMEOUT 300000 // 5 minutes of inactivity 64 void SSLErrors (
const QList<QSslError> &Errors);
69 void Error (QAbstractSocket::SocketError);
75 bool event (QEvent *Event)
override;
81 void SendHandshake (
void);
82 void ReadHandshake (
void);
84 void ProcessPayload (const QByteArray &Payload);
91 qintptr m_socketDescriptor;
92 QTimer m_watchdogTimer;
96 QString m_challengeResponse;
97 QHostAddress m_address;
104 int m_currentRequestID;
106 QMap<
int,
int> m_requestTimers;
108 QMultiMap<QString,QObject*> m_subscribers;
111 #endif // TORCWEBSOCKET_H void BytesWritten(qint64)
A class to encapsulate an incoming HTTP request.
void SubscriberDeleted(QObject *Subscriber)
A subscriber object has been deleted.
Overlays the Websocket protocol over a QTcpSocket.
A convenience class to read HTTP requests from a QTcpSocket.
void ConnectionUpgraded(void)
bool HandleNotification(const QString &Method)
void CancelRequest(TorcRPCRequest *Request)
Cancel a Remote Procedure Call.
A class encapsulating a Remote Procedure Call.
TorcWebSocket(TorcWebSocketThread *Parent, qintptr SocketDescriptor, bool Secure)
void SSLErrors(const QList< QSslError > &Errors)
bool event(QEvent *Event) override
static QVariantList GetSupportedSubProtocols(void)
Return a list of supported WebSocket sub-protocols.
void ReadyRead(void)
Process incoming data.
Wraps a TorcQThread around a TorcWebsocket.
void Error(QAbstractSocket::SocketError)
void PropertyChanged(void)
Receives notifications when a property for a subscribed service has changed.
void RemoteRequest(TorcRPCRequest *Request)
Initiate a Remote Procedure Call.
void Start(void)
Initialise the websocket once its parent thread is ready.
void ConnectionEstablished(void)