开发者

Google protobuf: Recommended C++ library to handle the communication?

开发者 https://www.devze.com 2023-03-08 03:06 出处:网络
Is there such framework or lib? That will take care of the client/server sockets parts too? Or just using something like BOOST::ASIO is the standard practice with开发者_StackOverflow中文版 protobuf?I

Is there such framework or lib? That will take care of the client/server sockets parts too? Or just using something like BOOST::ASIO is the standard practice with开发者_StackOverflow中文版 protobuf?


I use ZeroMQ together with protobuf.


I had hard time finding such a framework, so I wrote some (TLS) socket wrappers and a simple protobuf message channel. The library is available at prototls.


I use boost::asio and Poco::Net with protobuf, you dont need a specific framework or library to use a protobuf message, you dont even have to use a protobuf message just on network only, it creates binary version of that message that means you can transfer that binary data thorught network, store it on a file etc.

I would recommend to build your own protocol just for the sake of learning socket programming :-) using whatever socket library you want, winsock, boost::asio, Poco::Net, etc, Where boost::asio is the easier one using the async_ methods. I build a network framework in 5 hours (server/client) with multithreading capabilities

Again like many people said, boost::asio is the way to go, having an extra library just for something really simple (with boost) it's a waste.

0

精彩评论

暂无评论...
验证码 换一张
取 消