tinyrpc/test/codertest/main.cc

27 lines
550 B
C++
Raw Permalink Normal View History

2025-02-05 20:50:31 +08:00
#include <iostream>
#include "tinypb_coder.hpp"
#include "tinypb_data.hpp"
using namespace std;
using namespace tinyrpc;
int main() {
TinypbData data;
data.msg_req = "11231231312";
data.pb_data = "121231233456";
data.service_full_name = "aaa.b12313bb";
TinypbCoder coder;
TcpBuffer buffer;
TinypbData newdata;
coder.encoder(buffer, data);
coder.decoder(buffer, newdata);
cout << newdata.msg_req << endl;
cout << newdata.pb_data << endl;
cout << newdata.service_full_name << endl;
return 0;
}