Network library for the server side mmorpg (libuv / boost :: asio?)

I am currently rewriting the server side of a very old mmorpg, and I was looking for a good open source network library for use with C / C ++.

Since the client already exists, I cannot use any library that provides any kind of package structure or connection (for example, RakNet).

The server will use mainly UDP, on three different ports.

After searching the internet, I found out about boost :: asio and libuv.

boost :: asio seems like a mature option since I will be using boost already, but I read that their UDP implementation is a bit poor and that it cannot achieve maximum multi-core processor performance due to some blocking when using epoll.

libuv seems great, event driven, supported by a large project, but there is currently no such project that uses it, so I doubt its use.

What do you think? Can I use libuv in a similar project, or do I need to switch from boost :: asio? I am also open to other suggestions (they should be cross-platform, and I have already abandoned enet, libevent and libev).

+6
source share
2 answers

LiebΓ³w or Boost.Asio should be in order. I have seen similar results between libraries in both real-time and real-time applications.

If you are using Boost.Asio, keep in mind:

  • How to minimize the amount of memory allocation handler .
  • io_service lock can be removed by providing concurrency_hint 1 in the io_service constructor. However, this will not prevent blocking in the reactor.

From my experience in game development:

  • If the network capabilities are provided to the game code via an interface or a queue, then it is quite simple to swap between one event-based library to another event-based library, such as Boost.Asio and libuv.
  • Server architecture has a much greater impact than network code itself. Both Boost.Asio and libuv provide IPC functionality, which can be useful for multi-daemon server architectures.

Although there is some overlap between the two libraries, it may be useful to read this comparison.

+4
source

libevent is great, and it surprises me that you dropped it. ZeroMQ is not bad, but Windows support is a bit limited. RabbitMQ is with my daemon in SF.

Boost.asio is also very good. Since it seems that you are limited to C ++, then libevent is what I use, and it should far surpass other MMO names that I worked on in terms of network latency and flexible network, but this requires tcp.

+1
source

Source: https://habr.com/ru/post/943840/


All Articles