I am currently rewriting the server side of a very old mmorpg, and I was looking for a good opensource network library to use with C/C++.
As the client already exists, I can't use any library that enforces some kind of packet structure or communication (as, for example, RakNet).
The server will use mainly UDP, on three different ports.
After searching on the internet, I found out about boost::asio and libuv.
boost::asio seems like a mature option, as I will already be using boost, but I read that their UDP implementation is a little poor, and that it can't achieve the maximum performance of a multicore processor because of some locks when using epoll.
libuv seems great, is event-driven, supported by a big project, but currently there is no project of this kind using it, so I'm in doubt about usign it.
What do you people think? Can I use libuv in a project like that, or will I have to go with boost::asio? I am open to other suggestions too (they need to be cross-platform, and I already discarded enet, libevent and libev).
Either libuv or Boost.Asio should be fine. I have observed similar results between the libraries in both real-time and near-real-time applications.
If you do use Boost.Asio, be aware of:
io_service
locking can be eliminated by providing a concurrency_hint of 1 to the io_service
constructor. However, this will not prevent locking within the reactor.From my experience with game development:
While there is some overlap between the two libraries, it may be worthwhile to read this comparison.
libevent is excellent and it surprises me that you have discarded it. ZeroMQ is pretty good but Windows support is slightly limited. RabbitMQ is being by a fiend of mine in SF.
Boost.asio is also very good. Since it seems that you are limited to c++, then libevent is what I am using and it should far outstrip other MMO titles on which I have worked in terms of network latency and responsive networking, but it does require tcp.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With