working commit

This commit is contained in:
2026-04-24 16:50:15 +02:00
parent 37d9ee63cc
commit ace92da151
26 changed files with 3879 additions and 1893 deletions
+33 -4
View File
@@ -1,18 +1,47 @@
#include <cstring>
#include <expected>
#include <iostream>
#include <span>
#include <string>
#include <vector>
#include <sstream>
#include <google/protobuf/message.h>
#include <control.pb.h>
#include <rcpclient.hpp>
#include <rpcclient.hpp>
#include <rpcheader.hpp>
//google::protobuf::Message
std::expected<void, std::string> Transaction(const google::protobuf::Message& m) {
void Router(std::string& req, std::string& res) {
std::string rawResult;
control::HelloResult helloRes;
helloRes.Clear();
helloRes.set_name("foobare");
helloRes.set_id(12);
helloRes.SerializeToString(&rawResult);
res.append(rawResult);
}
std::expected<void, std::string> RPCClient::Transaction(const pbMessage& pbReq, pbMessage& pbRes) {
std::string rawRequest;
pbReq.SerializeToString(&rawRequest);
//RPCHeader header(rawRequest.size());
//auto rawHeader = header.Encode();
std::string reqPacket;
//request.append(rawHeader);
reqPacket.append(rawRequest);
std::string resPacket;
Router(reqPacket, resPacket);
pbRes.ParseFromString(resPacket);
return {};
}