[zeromq-dev] zmq_poll not working on Windows
Marko.Dieckmann at gmx.de
Marko.Dieckmann at gmx.de
Tue Oct 4 17:49:47 CEST 2011
Hi Mikko,
Thanks for the quick response!
That was it indeed. It's working now.
It's a bit confusing, though, because the struct has a void* in it. So I thought he wants the pointer. ;)
I'll look at the samples more closely next time.
Cheers,
Marko
----- Ursprüngliche Nachricht -----
Von: Mikko Koppanen
Gesendet: 04.10.11 17:30 Uhr
An: ZeroMQ development list
Betreff: Re: [zeromq-dev] zmq_poll not working on Windows
On Tue, Oct 4, 2011 at 4:12 PM, <Marko.Dieckmann at gmx.de> wrote: > Hello everyone, > > I tried to make zmq_poll work in my zmq 2.1.9 sample application for Windows > 7 (x64), but without success. > > For this test I have a PUB/SUB setup between 2 threads. > > // open INPROC socket to communicate with main thread > m_pInprocSocket = new zmq::socket_t(m_pZMQContext, ZMQ_SUB); > m_pInprocSocket->connect("inproc://thread_com"); > m_pInprocSocket->setsockopt(ZMQ_SUBSCRIBE, "", 0); > > Then in thread that opened the SUB socket I want to poll, like: > > zmq_pollitem_t pi[] = { m_pInprocSocket, 0, ZMQ_POLLIN, 0 }; Hi, if you look at the poll examples carefully (http://zguide.zeromq.org/cpp:mspoller) you need to pass the actual object to the poll_item_t rather than a pointer to it. Try: zmq_pollitem_t pi[] = { *m_pInprocSocket, 0, ZMQ_POLLIN, 0 }; thanks, mikko _______________________________________________ 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/20111004/a02fe39b/attachment.htm>
More information about the zeromq-dev
mailing list