mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-03 09:14:12 +02:00
Live mode: close each connection once it is answered
The qet MCP server connects once per request. On Windows a named pipe's disconnection reaches QLocalSocket late, so the second of two quick calls was turned away as "another assistant is already connected". Found testing the Windows package under Wine with a Windows-side client. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -254,6 +254,15 @@ void LiveServer::handle(const QJsonObject &request)
|
||||
if (request.contains(QStringLiteral("id")))
|
||||
answer.insert(QStringLiteral("id"), request.value(QStringLiteral("id")));
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user