3 #include <easylogging++.h>
4 #include <google/protobuf/io/coded_stream.h>
9 #include <unordered_map>
14 #include <RpcHeader.pb.h>
15 #include <ProtobufRpcEngine.pb.h>
16 #include <IpcConnectionContext.pb.h>
18 #include "socket_writes.h"
19 #include "socket_reads.h"
36 void serve(asio::io_service &io_service);
49 std::function<std::string(std::string)> handler);
65 std::unordered_map<std::string, std::function<std::string(std::string)>>
71 bool receive_handshake(
75 int16_t *auth_protocol);
81 bool receive_prelude(tcp::socket &sock);
86 void handle_rpc(tcp::socket sock);
94 bool send_error_header(
97 std::string response_header_str,
101 static const std::string CLASS_NAME;
std::string getUsername()
Definition: rpcserver.cc:271
void register_handler(std::string key, std::function< std::string(std::string)> handler)
Definition: rpcserver.cc:247
RPCServer(int port)
Definition: rpcserver.cc:19
Definition: rpcserver.h:27
void serve(asio::io_service &io_service)
Definition: rpcserver.cc:257