I have the following task:
Clients connect to a server on 1 port (e.g. 8080). The server should remember them and after completing calculation it should send results to the clients. After that server gets some results again and again sends it to all clients. And so on.
How can server mantain connections with all clients?
I’ve found some code uses PUB\SUB model and works with NAT here http://grokbase.com/t/zeromq/zeromq-dev/112q9934vg/nat-firewall-pub-sub-traversal:
Publisher that connects, rather than binds:
Subscriber that binds, rather than connects: