lestrrat/ZeroMQ-Perl — pull request #40 by tsee (2012-04-18 17:06:21+00:00)
Title: Let's make the return value of zmq_poll useful

I can try to supply equivalent patches for the newer libzmq2 and libzmq3 modules if you like.

It used to return the number of events fired or so. This was not
documented at the Perl wrapper level, just for the plain 0MQ library
call. It's much more useful to get information on WHICH events actually
fired, so this commit changes the return value of the zmq_poll XS to:

- undef if the zmq_poll C call failed (ie. returned -1 previously.
Now also sets $! from errno, which wasn't the case previously.)
- an array ref if it succeeded. The array ref will contain a 0 or 1 for
each socket in the poll list. 0 indicates that there was no event for
the given socket, 1 indicates that there was.