[zeromq-dev] 0MQ craching while polling in I/O thread
Martin Sustrik
sustrik at 250bpm.com
Mon Mar 29 17:51:26 CEST 2010
Dhammika Pathirana wrote:
> Hi Martin,
>
> But it's too confusing, why don't we do this in zmq_poll()?
>
> zmq::socket_t* sock1;
>
> items[ 0 ].socket = (void *)(*sock1); /* correct */
> items[ 0 ].socket = (void *)sock1; /* error */
It's confusing even the other way round. Consider this:
zmq::socket_t sock (ctx, ZMQ_P2P);
...
items [0].socket = (void*) &sock;
Getting the handle explicitly would be much better:
items [0].socket = sock.handle ();
However, whole polling interface is kind of half baked. In the future we
should aim for something like epoll (separate poller object).
Martin
More information about the zeromq-dev
mailing list