|
cxxmcp 1.1.6
C++ MCP SDK
|
Client transport backed by std::istream and std::ostream. More...
#include <stdio_transport.hpp>
Public Member Functions | |
| StdioTransport () | |
| Creates a stdio transport using standard input and output streams. | |
| StdioTransport (std::istream &input, std::ostream &output) | |
| Creates a stdio transport using caller-owned streams. | |
| core::Result< protocol::JsonRpcResponse > | send (const protocol::JsonRpcRequest &request) override |
| Sends one JSON-RPC request over the output stream and waits for a response. | |
| core::Result< core::Unit > | send_notification (const protocol::JsonRpcNotification ¬ification) override |
| Sends one JSON-RPC notification over the output stream. | |
| core::Result< core::Unit > | start (TransportRequestHandler request_handler, TransportNotificationHandler notification_handler={}) override |
| Starts receive-side dispatch for stream input. | |
Public Member Functions inherited from mcp::client::Transport | |
| virtual void | stop () noexcept |
| Requests transport shutdown. | |
Client transport backed by std::istream and std::ostream.
This transport is useful for tests, embedded integrations, or process environments where the streams are supplied by the caller instead of launching a child process.
send() is a single synchronous request/response exchange. The concrete stdio layer does not maintain an in-flight request registry, so duplicate in-flight request-id validation belongs to Peer/request-handle or role-generic transport adapters that add asynchronous correlation.
| mcp::client::StdioTransport::StdioTransport | ( | std::istream & | input, |
| std::ostream & | output | ||
| ) |
Creates a stdio transport using caller-owned streams.
| input | Stream read by the transport. The caller must keep it alive. |
| output | Stream written by the transport. The caller must keep it alive. |
|
overridevirtual |
Sends one JSON-RPC request over the output stream and waits for a response.
Implements mcp::client::Transport.
|
overridevirtual |
Sends one JSON-RPC notification over the output stream.
Reimplemented from mcp::client::Transport.
|
overridevirtual |
Starts receive-side dispatch for stream input.
| request_handler | Handler for inbound requests read from the stream. |
| notification_handler | Handler for inbound notifications read from the stream. |
Reimplemented from mcp::client::Transport.