[zeromq-dev] basic question - integrating zmq with a windows message pump
Martin Sustrik
sustrik at 250bpm.com
Fri Aug 20 12:44:42 CEST 2010
Hi David,
> Is it possible to integrate zmq into a standard MS Windows message
> pump/loop?
...
> I'd prefer to have the zmq on the same thread as the UI, i.e. doing
> something equivalent to QSAAsyncSelect. If this is possible I would like
> to use zmq for intra-process, inter-thread communication.
In the trunk, there's no such option.
However, you can try sustrik/zeromq2, an experimental branch that
exposes ZMQ_FD and ZMQ_EVENTS socket option.
getsockopt(ZMQ_FD) returns the file descriptor associated with the 0MQ
socket. You can use WSAAsyncSelect on it, specifying FD_READ as lEvent.
Once the event is triggered, it means something has happened with the
socket. At that point, do getsockopt (ZMQ_EVENTS) that'll let you know
whether socket is ready for reasing writing or both.
Martin
More information about the zeromq-dev
mailing list