简体   繁体   English

如果我想要事件驱动服务器,该使用什么 libevent 或 libev?

[英]If i want event driven server what to use libevent or libev?

i want to make basic chat server using one of the event driven libarary.我想使用事件驱动库之一制作基本的聊天服务器。 but what to chose?但是选择什么? libevent or libev what is better? libevent 或 libev 哪个更好? which has better c++ support?哪个有更好的 c++ 支持? which runes better in windows? windows 中哪个符文更好? what is faster?什么是更快? faster to develop and understand更快地开发和理解

I prefer libev.我更喜欢libev。 It's very minimalistic and some of the benchmarks (probably old) I've seen indicate it performs better.它非常简约,我见过的一些基准(可能是旧的)表明它表现更好。 The documentation is also quite good.文档也相当不错。

I prefer libevent because我更喜欢 libevent 因为
1) it has an http server (both native one and as an external project ), 1)它有一个 http 服务器(本地和作为外部项目),
2) http client (really useful if you need your event-driven server to use external services); 2)http客户端(如果你需要你的事件驱动服务器使用外部服务真的很有用); libev has one, but it won't compile for me with recent libev libev 有一个,但它不会用最近的 libev 为我编译
3) dns server (I use it to automatically redirect traffic for high availability) 3) dns 服务器(我用它来自动重定向流量以实现高可用性)
4) IMO, better docummentation 4)IMO,更好的文档
5) is better maintained (see 2) 5) 维护得更好(见 2)

The choice isn't just between libevent and libev.选择不仅仅是在 libevent 和 libev 之间。 Boost.asio is excellent. Boost.asio 非常好。 The programming model works well, and it is integrated into Boost which you should be using anyway.编程 model 运行良好,它集成到您应该使用的 Boost 中。

If you're just learning, you are unlikely to notice any speed differences caused by the library.如果您只是在学习,您不太可能注意到由库引起的任何速度差异。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM