ZeroMQ模式查询 [英] ZeroMQ pattern query

查看:237
本文介绍了ZeroMQ模式查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用ZeroMQ在C ++中实现服务器/客户端交互( http://zeromq.org/ ) 。

I want to implement a server/client interaction in C++ using ZeroMQ (http://zeromq.org/).

我的要求是实现一个函数,其中如果客户端向服务器发送请求,则服务器应该将多个数据(按顺序)发送回客户端。

My requirement is to implement a function where if a client sends a request to the server, the server should send multiple pieces of data (in a sequence) back to the client. The client should be able to repeatedly send the request with the server replying with multiple pieces of data on each request.

ZeroMQ规定了像req-res,pub-sub这样的模型,推拉,但这不支持我的要求,因为:

ZeroMQ prescribes models like req-res, pub-sub, push-pull, but this does not support my requirement because:

1)Req-rep模式总是期望一个返回消息,即它被设计为发送和接收的组合

1) Req-rep pattern always expects a return message i.e. it is designed as a combination of send and receive

2)pub-sub和push-pull是单向的

2) pub-sub and push-pull are unidirectional

哪个ZeroMQ模式适合我的要求,还有哪个协议会更好的TCP,PGM,EPGM等....

Which ZeroMQ pattern would suit my requirement, and also which protocol would be better TCP, PGM, EPGM etc....!

谢谢

推荐答案

查看ZMQ经销商 - 路由器架构:
http://www.zeromq.org/tutorials:dealer-and-router

Have a look at ZMQ dealer-router architectures: http://www.zeromq.org/tutorials:dealer-and-router

您应该能够处理特定的客户,而不必坚持严格请求回复类型消息流。

You should be able to address specific clients and not have to adhere to the strict request reply type message flow.

这篇关于ZeroMQ模式查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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