Pulling requests from multiple clients with ZMQ

ぐ巨炮叔叔 提交于 2020-01-13 18:07:05

问题


I have a couple of workers waiting to do some jobs. I see that in the PULL/PUSH pattern I need to give the workers the ip address (using the tcp protocol) of the client, so it can listen to requests from there. However, in my case I want to have a lot of clients as well, coming from different IPs with requests... So basically I dont really have a static IP to bind the worker to PULL from. Am I using the wrong pattern or is there a way to do it correctly?


回答1:


You should consider using the router-dealer pattern. Your router binds at 2 ends and it has a static IP. It pulls from the multiple clients that connect to it and pushes to the workers on the other end. You can use the ROUTER/DEALER socket types to make this or just use an extra bridge using PUSH/PULL sockets to connect the clients to the workers.



来源:https://stackoverflow.com/questions/10062104/pulling-requests-from-multiple-clients-with-zmq

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!