[zeromq-dev] multiple REQ-REP sockets, polling responses

Maciej Wewior m.wewior at is-wireless.com
Tue Jul 19 10:52:28 CEST 2016

Hi all

I have 2 nodes communicating by means of multiple ZMQ sockets. The way 
they talk to each other is request-response, from some reasons I want to 
have separate sockets for each established connection.
Since they communicate in the classic request-response manner I thought 
I could use REQ-REP ZMQ socket pair for each socket connection. But then 
I realised that due to synchronous nature of REQ-REP I will have to wait 
for each single response till I'm able to send a request on another ZMQ 
socket (and I don't want this restriction).

Could someone give me an advice how to deal with that using ZMQ?
I would like to be able to send some number of requests through separate 
sockets one after another (without waiting for response) and then poll 
all the responses and process them one after another (order doesn't matter).
(I now I could for example use PUB-SUB socket pair instead of one 
REQ-REP socket and fire requests using the 1st ones from the pair and 
poll the responses from the 2nd ones, but that seems more complex than I 
would like it to be)

Thanks in advance.

Maciej Wewior
Senior Software Developer

fixed +48 22 213 8297

ul. Pulawska 45b
05-500 Piaseczno/near Warsaw
Poland, EU
http://is-wireless.com <http://is-wireless.com/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20160719/29975cc5/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: isw mail.png
Type: image/png
Size: 5384 bytes
Desc: not available
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20160719/29975cc5/attachment.png>

More information about the zeromq-dev mailing list