|
Sonde v1.1.0
Embeddable Model Context Protocol server for Qt applications
|
A client on the local socket: newline-delimited JSON. More...
Public Member Functions | |
| LocalClient (const QString &name, Verdict *verdict, QElapsedTimer *clock) | |
Connects to name and initializes. | |
| bool | connected () const override |
| Whether it can still send. | |
| QString | kind () const override |
| The transport's name, for the log. | |
| void | disconnectNow () override |
| Drops the connection: pending requests are forgotten (no answer is owed). | |
| Public Member Functions inherited from anonymous_namespace{main.cpp}::Client | |
| Client (Verdict *verdict, QElapsedTimer *clock) | |
Reports violations to verdict, timing requests with clock. | |
| int | send (const QString &method, const QJsonObject ¶ms={ }, const QString &tool={ }) |
| Sends a request; returns its id. | |
| void | notify (const QString &method, const QJsonObject ¶ms={ }) |
| Sends a notification. | |
| void | cancel (int id) |
Cancels request id, if it is still pending. | |
| QList< int > | pendingIds () const |
| Ids still waiting for an answer. | |
| void | checkTimeouts () const |
| Fails the verdict for requests unanswered past the timeout (cancelled ones aside). | |
| bool | settled () const |
| Whether everything not cancelled has been answered. | |
| QStringList | takeTexts () |
| The texts of the last results, for harvesting ids and window titles. | |
Protected Member Functions | |
| void | transmit (const QJsonObject &message, int) override |
Sends message; id is its request id, or -1 for a notification. | |
| Protected Member Functions inherited from anonymous_namespace{main.cpp}::Client | |
| void | fail (const QString &what) const |
| Records a violation. | |
| void | forget (int id) |
Forgets request id: its answer will never come, and none is owed. | |
| void | handle (const QByteArray &bytes) |
| Checks one message from the server. | |
Private Member Functions | |
| void | read () |
| Reads and checks whole lines. | |
Private Attributes | |
| QLocalSocket | m_socket |
| The connection. | |
| QByteArray | m_buffer |
| Unread input. | |
Additional Inherited Members | |
| Public Attributes inherited from anonymous_namespace{main.cpp}::Client | |
| QJsonArray | tools |
| The last tools/list result. | |
| int | results = 0 |
| tools/call results received. | |
| int | toolErrors = 0 |
| Of those, the ones with isError. | |
| Static Protected Member Functions inherited from anonymous_namespace{main.cpp}::Client | |
| static QJsonObject | initializeParams () |
| The initialize request's parameters. | |
A client on the local socket: newline-delimited JSON.
|
inlineoverridevirtual |
Whether it can still send.
Implements anonymous_namespace{main.cpp}::Client.
|
inlineoverridevirtual |
Drops the connection: pending requests are forgotten (no answer is owed).
Reimplemented from anonymous_namespace{main.cpp}::Client.
|
inlineoverridevirtual |
The transport's name, for the log.
Implements anonymous_namespace{main.cpp}::Client.
|
inlineoverrideprotectedvirtual |
Sends message; id is its request id, or -1 for a notification.
Implements anonymous_namespace{main.cpp}::Client.