如何创建适合发送和使用的ZeroMQ套接字? [英] How to create ZeroMQ socket suitable both for sending and consuming?

查看:99
本文介绍了如何创建适合发送和使用的ZeroMQ套接字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在以下情况下,您能否建议ZeroMQ套接字体系结构:

Could you please advice an ZeroMQ socket(s) architecture for the following scenario:

1)服务器正在端口侦听

1) there is server listening on port

2)有多个客户端同时连接服务器

2) there are several clients connecting server simultaneously

3)服务器接受来自客户端的所有连接,并为每个客户端提供双向队列,这意味着双方(客户端N或服务器)都可以发送或使用消息,即,双方可以是通信的发起人,而另一方应具有用于处理消息的回调.

3) server accept all connections from clients and provide bi-directional queue for each client, means both party (client N or server) can send or consume messages, i.e. both party can be INITIATOR of the communication and other party should have a callback to process the message.

我们是否应该在每个接受的连接上创建其他ZeroMQ套接字以推送来自服务器的消息?您能为此类架构建议使用哪种ZeroMQ套接字类型给Google吗?

Should we create additional ZeroMQ socket on each accepted connection for pushing messages from server? Could you please advice of which ZeroMQ socket type to google for such architecture?

推荐答案

Q :…在每个接受的连接上创建附加的ZeroMQ套接字以推送来自服务器的消息吗?

最好的基于平凡构图的设计-在缩放方面和安全方面都是

The best trivial composition-based design - both scaling-wise and security-wise

原生ZeroMQ原语(智能原语可伸缩形式通信模式原型")对我们来说就像是乐高积木-我们将其进一步应用到应用域中预期目标用途的消息传递/信令平面上./p>

The native ZeroMQ primitives ( the smart primitive Scalable Formal Communications Pattern Archetypes ) are like a LEGO building-blocks for us - we compose their further use on the Messaging/Signalling Plane of the intended target use in our application-domain.

Q :能否请您告知Google对于这种架构应使用哪种ZeroMQ套接字类型?

否,因为没有详细的要求列表可用于此建议.一对 PUSH/PULL -不需要自己满足,临时执行的(临时的) REQ/REP 可能有助于客户端(重新)发现阶段,就像其他共存的,持久的或情节性的原型可以用来组成任何其他系统/服务平面一样.

No, given no detailed requirements list was available for such an advice. A pair of PUSH/PULL-s need not suffice on their own, temporarily conducted ( episodic ) REQ/REP may help for the client-(re-)discovery phases, as might other co-existent, persistent or episodic Archetypes do for composing any additional System/Service-Planes.

这篇关于如何创建适合发送和使用的ZeroMQ套接字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆