[zeromq-dev] DEALER - ROUTER and unsolicited ROUTER to DEALER sends

Niels Berglund niels.it.berglund at gmail.com
Wed Apr 10 20:17:13 CEST 2013


Hi guys,

OK, so lately I have been posting some questions here and the answer has
more or less been to RTFM. That is OK, the problem is that no matter how
much I RTFM, I cannot get my head around a particular problem, so once
again I post a question. I do not expect an answer in the form; do this,
this and this, and you have solved your problem plus obtained peace in the
world (yes 0MQ IS powerful), BUT - I would expect something else than "RTFM
and work it out by yourself".

Anyway, my question is if 0MQ is suporting an architecture, whereby a
DEALER socket would connect to a ROUTER socket, the DEALER would send one
or more messages, and receive responses. Then the DEALER socket might be
in-active, but it could receive a message from the ROUTER socket, i.e. an
unsolicited SEND from the ROUTER to the dealer.

I know that it is theoretically supported, i.e. I have done it, but it
could cause issues with multiple threads accessing the DEALER socket at the
same time. In other words, my main app thread is creating the the socket
and can send on the socket, but at the same time I need a poller to receive
messages, which by the nature of it would need to run on a separate thread.
In this instance I can get into threading issues.

In all the examples I have seen, Majordomo etc., the DEALER SEND's and then
RECEIVES, which to me is the same as a synchronous REQ - REP. Yes, I can
send multiple messages after each other, but if I happen to send at the
same time as a message is "polled" I'll get an assertion.

So, once again - am I completely "off the wall" trying to achieve this, if
I am  - what is the 0MQ way to do it, if not - again - what is the 0MQ way
to do it?

Niels
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130410/7154ae66/attachment.htm>


More information about the zeromq-dev mailing list