Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make send recv serialization more readable by writting the ByteBuffer using a protobuf message. #9766

Closed
typhoonzero opened this issue Apr 9, 2018 · 5 comments
Assignees

Comments

@typhoonzero
Copy link
Contributor

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())
@typhoonzero typhoonzero self-assigned this Apr 9, 2018
@typhoonzero
Copy link
Contributor Author

@gongweibao is there a way to simplify variable_response.cc code?

@gongweibao
Copy link
Contributor

Deserialization is implemented in variable_reponse.cc.
Do you mean to merge them into ProtoEncodeHelper class?

@typhoonzero
Copy link
Contributor Author

Please check out #10531, in which I simplified serialization codes, can we do the same thing in variable_reponse.cc?

@gongweibao
Copy link
Contributor

It's a good idea.

@gongweibao gongweibao self-assigned this May 23, 2018
@gongweibao
Copy link
Contributor

We can't deserialize part of proto.
So I close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants