Is There any way to achieve a ZeroMQ fullduplex channel?

烈酒焚心 提交于 2019-12-06 09:36:29

There are several ways to do this with ZeroMQ. I suggest using a DEALER/ROUTER socket pair:

  • Choose one program to be the "server", the other the "client".
  • The server will bind a ROUTER socket on a port.
  • The client will connect a DEALER socket to the server's ROUTER port. (Note: this implies that the client must know the server's IP and port in advance.)

At this point the client can send messages to the server, but the server has no way to send to the client.

  • The client sends a "HELLO" message to the server.

The server will receive a message that includes the client's address and the HELLO message. Now the server can send messages to the client using the client's address.

DEALER/ROUTER is considered an "advanced" socket pair in ZeroMQ. My description here is very high level. You'll really need to read the docs to get the most out of ZeroMQ.

Oh yes, Sir!

Use the PAIR-PAIR or even the XREQ-XREP ought make it.

The best next step is to carefully read the respective Scalable Formal Communication Pattern archetypes' access-points' API documentation, so as to cross-check, that all pieces of pre-wired behavioural logic meet your Project needs and voilá, harness them in your messaging setup and tune-up the settings so as to meet you performance and latency needs.

That is this simple ( thanks to all the genuine knowhow hidden in these builtins ).

Using for years this very sort of inter-platforms integration among Python + C/MQL4 and other computing nodes, so well worth one's time to learn the powers and strengths of ZeroMQ.

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