|
Sonde v1.1.0
Embeddable Model Context Protocol server for Qt applications
|
Newline-delimited JSON-RPC over a QLocalServer (localtransport.cpp). More...
#include <server_p.h>
Classes | |
| struct | Connection |
| Per-connection state: the socket, its session, and data not yet split into lines. More... | |
Public Member Functions | |
| LocalTransport (ServerPrivate *server) | |
Creates the transport for server (not listening yet). | |
| ~LocalTransport () override | |
| Ends all local sessions and closes their sockets. | |
| bool | listen (const QString &name) |
Starts listening on name. | |
| QString | fullServerName () const |
| The full socket path or pipe name. | |
| QString | serverName () const |
| The name passed to listen(). | |
| void | closeSession (const QString &id) |
Closes the connection that carries session id, once what was written to it has been sent. | |
Private Member Functions | |
| void | onNewConnection () |
| Accepts connections; each becomes a session. | |
| void | onReadyRead (const std::shared_ptr< Connection > &conn) |
Splits buffered data on conn into lines and handles each. | |
| void | handleLine (const std::shared_ptr< Connection > &conn, const QByteArray &line) |
| Handles one line: a JSON-RPC message or a legacy batch. | |
| void | handleBatch (const std::shared_ptr< Connection > &conn, const SessionPtr &session, const QJsonArray &batch) |
| Handles a legacy (2025-03-26) batch, answering with one array line. | |
Private Attributes | |
| ServerPrivate * | d |
| Server implementation. | |
| QLocalServer * | m_server = nullptr |
| Listening socket. | |
Newline-delimited JSON-RPC over a QLocalServer (localtransport.cpp).
|
private |
Handles a legacy (2025-03-26) batch, answering with one array line.
< Responses so far, in completion order.
< Requests not yet answered.
| bool Sonde::LocalTransport::listen | ( | const QString & | name | ) |
Starts listening on name.