JSON-RPC 2.0
JSON-RPC 2.0 Modern C++ Library
Loading...
Searching...
No Matches
framed_stdio_transport.cpp
Go to the documentation of this file.
2
3#include <iostream>
4
5#include <spdlog/spdlog.h>
6
7namespace jsonrpc::transport {
8
9void FramedStdioTransport::SendMessage(const std::string &message) {
10 spdlog::debug("FramedStdioTransport sending message: {}", message);
11 FrameMessage(std::cout, message);
12 std::cout << std::flush;
13}
14
16 std::string response = ReceiveFramedMessage(std::cin);
17 spdlog::debug("FramedStdioTransport received message: {}", response);
18 return response;
19}
20
21} // namespace jsonrpc::transport
auto ReceiveMessage() -> std::string override
Receives a message from the transport layer.
void SendMessage(const std::string &message) override
Sends a message in string to the transport layer.
static void FrameMessage(std::ostream &output, const std::string &message)
Constructs a framed message.