Merge pull request #2147 from goodfella/fix-zmq-poller-poll-return

Fix zmq poller poll return
This commit is contained in:
Luca Boccassi 2016-10-01 11:44:08 +01:00 committed by GitHub
commit 88e4cff948
3 changed files with 7 additions and 2 deletions

View File

@ -31,6 +31,11 @@
#include "macros.hpp"
#include <string.h>
#ifndef ZMQ_HAVE_WINDOWS
#include <unistd.h>
#endif
#include <new>
#include <sstream>

View File

@ -842,7 +842,7 @@ inline int zmq_poller_poll (zmq_pollitem_t *items_, int nitems_, long timeout_)
}
// Cleanup
rc = zmq_poller_destroy (&poller);
zmq_poller_destroy (&poller);
delete [] events;
return rc;
}

View File

@ -167,7 +167,7 @@ int main (void)
{ dish, 0, ZMQ_POLLIN, 0 }, // read subscriptions
};
rc = zmq_poll(items, 2, 2000);
assert (rc == 0);
assert (rc == 1);
assert (items[1].revents == ZMQ_POLLIN);
// Check the correct message arrived