MCPcopy Create free account
hub / github.com/awawa-dev/HyperHDR / readRequest

Method readRequest

sources/jsonserver/JsonClientConnection.cpp:26–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26void JsonClientConnection::readRequest()
27{
28 _receiveBuffer += _socket->readAll();
29 // raw socket data, handling as usual
30 int bytes = _receiveBuffer.indexOf('\n') + 1;
31 while (bytes > 0)
32 {
33 // create message string
34 QString message(QByteArray(_receiveBuffer.data(), bytes));
35
36 // remove message data from buffer
37 _receiveBuffer = _receiveBuffer.mid(bytes);
38
39 // handle message
40 _hyperAPI->handleMessage(message);
41
42 // try too look up '\n' again
43 bytes = _receiveBuffer.indexOf('\n') + 1;
44 }
45}
46
47qint64 JsonClientConnection::sendMessage(QJsonObject message)
48{

Callers

nothing calls this directly

Calls 3

QByteArrayClass · 0.85
dataMethod · 0.80
handleMessageMethod · 0.45

Tested by

no test coverage detected