1 #ifndef TORCWEBSOCKETREADER_H 2 #define TORCWEBSOCKETREADER_H 8 #define TORC_JSON_RPC QStringLiteral("torc.json-rpc") 93 void HandlePing (QByteArray &Payload);
94 void HandlePong (QByteArray &Payload);
95 void HandleCloseRequest (QByteArray &Close);
107 QTcpSocket &m_socket;
110 bool m_closeReceived;
113 OpCode m_subProtocolFrameFormat;
116 ReadState m_readState;
118 bool m_frameFinalFragment;
120 bool m_haveBufferedPayload;
121 QByteArray m_bufferedPayload;
122 OpCode m_bufferedPayloadOpCode;
123 quint64 m_framePayloadLength;
124 quint64 m_framePayloadReadPosition;
125 QByteArray m_frameMask;
126 QByteArray m_framePayload;
129 Q_DECLARE_OPERATORS_FOR_FLAGS(TorcWebSocketReader::WSSubProtocols)
130 #endif // TORCWEBSOCKETREADER_H void SetSubProtocol(WSSubProtocol Protocol)
static QList< WSSubProtocol > SubProtocolsFromPrioritisedString(const QString &Protocols)
Parse a prioritised list of supported WebSocket sub-protocols.
const QByteArray & GetPayload(void)
Overlays the Websocket protocol over a QTcpSocket.
static QString SubProtocolsToString(WSSubProtocols Protocols)
Convert SubProtocols to HTTP readable string.
void SendFrame(OpCode Code, QByteArray &Payload)
static QString CloseCodeToString(CloseCode Code)
Convert CloseCode to human readable string.
static WSSubProtocols SubProtocolsFromString(const QString &Protocols)
Parse supported WSSubProtocols from Protocols.
void InitiateClose(CloseCode Close, const QString &Reason)
static OpCode FormatForSubProtocol(WSSubProtocol Protocol)
static QString OpCodeToString(OpCode Code)
Convert OpCode to human readable string.