[zeromq-dev] zmq::poll.

Martin Sustrik sustrik at 250bpm.com
Tue Mar 1 18:06:08 CET 2011

On 03/01/2011 06:12 PM, Skrzyniarz Alexandre wrote:

> By the way, the zmq_cpp man page says:
>         The poll() function is a namespaced equivalent of the zmq_poll()
>         function, as described in zmq_poll(3).
>             Note
>             To obtain a 0MQ socket for use in a zmq_pollitem_t
>             structure, you should cast an instance of the socket_t class
>             to (void *).

You've cast pointer to socket_t to void* instead of socket_t to void*.

But right, it's messy and prone to error.

Probably the best solution would be to extract the handle explicitly:

item.socket = sock.handle ();


More information about the zeromq-dev mailing list