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

Andriy Drozdyuk drozzy at gmail.com
Tue Jul 19 15:24:20 CEST 2016


Take a look at dealer and router (read it over a few times until you
understand what each one does - router is rather tricky):
http://zguide.zeromq.org/page:all#advanced-request-reply

Also I find this cheat sheet on legal combinations useful (you probably
want dealer-router):
http://zguide.zeromq.org/page:all#Request-Reply-Combinations

I suggest you write examples of each combination and try to break them
(e.g. can you send a message from router to dealer?)

On Tue, 19 Jul 2016, 4:52 a.m. Maciej Wewior, <m.wewior at is-wireless.com>
wrote:

> 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
>
> IS-Wireless
> ul. Pulawska 45b
> 05-500 Piaseczno/near Warsaw
> Poland, EU
> http://is-wireless.com
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20160719/ca656cce/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/ca656cce/attachment.png>
-------------- 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/ca656cce/attachment-0001.png>


More information about the zeromq-dev mailing list