3 #include <utils/Logger.h> 4 #include "webserver/WebSocketUtils.h" 13 WebSocketClient(QByteArray socketKey, QTcpSocket* sock, QObject* parent);
20 quint64 payloadLength;
26 QByteArray _secWebSocketKey;
31 void sendClose(
int status, QString reason =
"");
33 qint64 sendMessage_Raw(
const char* data, quint64 size);
34 qint64 sendMessage_Raw(QByteArray &data);
35 QByteArray makeFrameHeader(quint8 opCode, quint64 payloadLength,
bool lastFrame);
38 QByteArray _receiveBuffer;
41 QByteArray _wsReceiveBuffer;
44 bool _onContinuation =
false;
47 bool _notEnoughData =
false;
53 static uint8_t
const BHB0_OPCODE = 0x0F;
54 static uint8_t
const BHB0_RSV3 = 0x10;
55 static uint8_t
const BHB0_RSV2 = 0x20;
56 static uint8_t
const BHB0_RSV1 = 0x40;
57 static uint8_t
const BHB0_FIN = 0x80;
59 static uint8_t
const BHB1_PAYLOAD = 0x7F;
60 static uint8_t
const BHB1_MASK = 0x80;
62 static uint8_t
const payload_size_code_16bit = 0x7E;
63 static uint8_t
const payload_size_code_64bit = 0x7F;
65 static const quint64 FRAME_SIZE_IN_BYTES = 512 * 512 * 2;
68 void handleWebSocketFrame(
void);
69 qint64 sendMessage(QJsonObject obj);
Definition: WebSocketClient.h:10