I am using the cluster
module and in each of the worker processes I need to publish certain values out to a single server, which subscribes to each worker.
I am using the zmq PUB
socket in each worker process, but when each worker socket binds on the same port it causes a conflict and doesn't work. What socket pattern should I use so that I can publish/push/send values from my worker processes and subscribe to them with my server process?
Reverse the pub-sub bind-connect. Sub binds and Pub connects solves the problem.
来源:https://stackoverflow.com/questions/24276128/how-should-i-handle-multiple-publishers-on-the-same-port-on-the-same-host