JSON-RPC 2.0
JSON-RPC 2.0 Modern C++ Library
Loading...
Searching...
No Matches
framed_socket_transport.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <asio.hpp>
4#include <asio/local/stream_protocol.hpp>
5#include <cstdint>
6#include <string>
7
10
11namespace jsonrpc::transport {
12
18 protected FramedTransport {
19 public:
20 FramedSocketTransport(const std::string &host, uint16_t port, bool is_server);
21
22 void SendMessage(const std::string &message) override;
23 auto ReceiveMessage() -> std::string override;
24};
25
26} // namespace jsonrpc::transport
Transport layer using Asio sockets for JSON-RPC communication with framing.
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.
FramedSocketTransport(const std::string &host, uint16_t port, bool is_server)
Base class for framed transport mechanisms.
Transport implementation using TCP/IP sockets.