mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-25 15:34:13 +01:00
Merge branch 'feature/script-live' into feature/script-live-ask-first
This commit is contained in:
@@ -280,6 +280,15 @@ void LiveServer::handle(const QJsonObject &request)
|
|||||||
if (request.contains(QStringLiteral("id")))
|
if (request.contains(QStringLiteral("id")))
|
||||||
answer.insert(QStringLiteral("id"), request.value(QStringLiteral("id")));
|
answer.insert(QStringLiteral("id"), request.value(QStringLiteral("id")));
|
||||||
send(answer);
|
send(answer);
|
||||||
|
//One request per connection: close it from this side once it is
|
||||||
|
//answered. Waiting for the client to hang up raced the next
|
||||||
|
//request on Windows, where a named pipe's disconnection reaches
|
||||||
|
//QLocalSocket late -- the second call of a quick pair was turned
|
||||||
|
//away as "another assistant" (found under Wine, 2026-10-02).
|
||||||
|
if (m_client) {
|
||||||
|
m_client->disconnectFromServer();
|
||||||
|
m_client = nullptr;
|
||||||
|
}
|
||||||
emit handled(request, answer);
|
emit handled(request, answer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,8 +40,8 @@ class QWidget;
|
|||||||
The channel is a QLocalServer only the user's own account can open,
|
The channel is a QLocalServer only the user's own account can open,
|
||||||
with a random name and token written to live-session.json in the data
|
with a random name and token written to live-session.json in the data
|
||||||
folder, which the MCP server reads; the file goes when the channel
|
folder, which the MCP server reads; the file goes when the channel
|
||||||
closes. One request per line, one answer per line, both JSON; every
|
closes. One JSON request per connection, one JSON answer back, then
|
||||||
request carries the token.
|
the server closes the connection; every request carries the token.
|
||||||
|
|
||||||
Requests are never handled inside the socket's readyRead: each is
|
Requests are never handled inside the socket's readyRead: each is
|
||||||
queued to the event loop first. QETApp::receiveMessage() learnt why --
|
queued to the event loop first. QETApp::receiveMessage() learnt why --
|
||||||
|
|||||||
Reference in New Issue
Block a user