Hello,
I have the following code to dispatch incoming messages via inproc
transport in one thread, and to stop the dispatcher from another (main)
thread:
void dispatch()
{
zmq::socket_t control_socket_ ( _global_context, ZMQ_PAIR );
control_socket_ .connect( "inproc://control" );
zmq::pollitem_t items[] = {
{ data_socket_, 0, ZMQ_POLLIN, 0 },
{ control_socket_, 0 , ZMQ_POLLIN, 0 }
};
while(1)
{
zmq::poll( items, 2)
if(items[0].revents & ZMQ_POLLIN)
{
// ... dispatch incoming messages ..
}
if(items[1].revents & ZMQ_POLLIN)
break;
}
}
In another (main) thread, I send an empty message to "inpoc://control" when
I want to stop the dispatch.
The problem that this stopping is somehow very slow.
Why could be that?
I am using zeromq-2.1.11 on Windows XP SP3, Visual Studio 2008.
Thanks,
--
Daniel Krikun
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev