Question

Currently I am using enet to stream info, updated multiple times per second, to a list of provided ip addresses / ports. I am creating a client connection for each of these addresses (and there are server enet host connections running on those computers).

I am wondering if there is a more efficient way to send these messages(or simply a better solution to the problem)? Some way that I do not have to create a enet host for each connection? I do need reliable delivery.

I am only using enet as it is convenient and already available in the system I am using.

Was it helpful?

Solution

A great solution for this problem is ZeroMQ.

It is a networking library with C++ bindings that specializes in the reliable delivery of messages in a variety of configurations, like the pub/sub model that looks like what you are trying to do.

ZeroMQ would effectively allow you to not even need to list the IPs of the subscribers, since they would indeed subscribe by connecting to your publisher. The publisher then would send data regardless of the number of subscribers (see http://zguide.zeromq.org/page:all#Getting-the-Message-Out).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top