[zeromq-dev] [nzmqt] Need feedback for new poll-based event loop implementation for Qt C++ binding 'nzmqt'
jonny.dee at gmx.net
Tue Jan 31 01:13:31 CET 2012
several months ago I started "nzmqt" project:
> I just would like to let you know that I've re-implemented 'zeromqt'
> using ZeroMQ's official C++ binding. It's called 'nzmqt' (https://
> github.com/jonnydee/nzmqt) and is a complete re-write which not only
> supports PUB-SUB, but also REQ-REP and PUSH-PULL protocol. (Others
> might work but have not been tested yet.) There are also samples
> showing these protocols in action. For PUSH-PULL I've implmented the
> 'Ventilator-Worker-Sink' example introduced in ZMQ's guide. It's
> officially released under the BSD license. Maybe some of you might
> want to have a look.
Since the official annoucement people reported some issues. They are
all related to Qt's QSocketNotifier class I used for listening to ZMQ
socket events. And until now, I don't have a solution that uses this
class and works for PUSH-PULL, PUB-SUB, and REQ-REP at the same time.
So now I've written another implementation, which is based on periodic
polling for ZMQ events and avoids using QSocketNotifier. While the old
implementation is still available the new one is the default one. The
test applications that come with nzmqt show that it works, at least on
my machine (OS X). But I would appreciate to get feedback from other
users of nzmqt. Does my solution work for all your configurations now?
Also, if anyone has managed to implement a QSocketNotifier based
integration into Qt's event loop wich also works with REQ-REP protocol
I'd be very glad if I could get some hints on how to do this. All my
experiements I did were unsuccessful. I guess the problem is the
nature of ZMQ_REQ and ZMQ_REP sockets, because, in contrast to PUB-SUB
and PUSH-PULL, they each communicate in both directions. But I might
be wrong, it's just a guess. All information regarding using Qt's
QSocketNotifier class with ZMQ sockets I could find show how to use a
such a notifier in READ mode. However, for REQ-REP one also needs a
second one in WRITE mode. Experiments show that a single one in READ
mode does not suffice, at least. So it would be great if someone could
show me how to do it right. :)
Many thanks in advance and best regards,
More information about the zeromq-dev