We can rewrite the serialization and deserialization for send/recv using the following sample code, thanks Xu laoshi for reminding.
sendrecv::VariableMessage request;
request.set_name(var_name);
...
std::string header;
request.AppendToString(&header);
ProtoEncodeHelper e(static_cast<char*>(buf), 1024);
e.WriteRaw(header.data(), header.size())