I’m using C++ to develop the server side of a game which multiple servers need to communicate with each other using Publisher/Subscriber pattern. Each server subscribes to some events on different servers. All servers are located on the same network so latency and packet-loss should be very low. The inter-server communication should be as efficient as possible since many events happen each second.
Are there any libraries out there i can use for this purpose?
Any help is much appreciated
You should be able to combine Boost.ASIO (for async sockets I/O) with Boost.Signals (for Observer pattern) or Boost.Signals2 (threadsafe version of Boost.Signals) to achieve what you want.
There is a simple example showing how this might work here. Note that this uses a wrapper on Boost.Signal, but you get the idea.