[zeromq-dev] Possible zpoller issue

Justin Azoff justin.azoff at gmail.com
Sat Sep 16 05:53:41 CEST 2017


Am I doing something wrong with zpoller here, or is this a bug?

#include "czmq_library.h"

int main(int argc, char **argv)
{

    zsock_t * sock =  zsock_new (ZMQ_DEALER);
    zsock_connect(sock, "tcp://172.0.0.1:9999");
    zpoller_t *poller = zpoller_new (NULL);
    if(zpoller_add (poller, sock)) {
        zsys_debug("add failed?!?");
    }
    zsys_debug("Polling...");
    void *ret = zpoller_wait (poller, 3000);
    zsys_debug("Done.");
    zsys_debug("zpoller_wait() is %s", ret ? "not null" : "null");

    zsys_debug("zpoller_expired() is %s", zpoller_expired(poller) ?
"true" : "false");
    zsys_debug("zpoller_terminated() is %s",
zpoller_terminated(poller) ? "true" : "false");
    zsock_destroy(&sock);

}

 $ make && ./poll
make: Nothing to be done for `all'.
D: 17-09-15 22:49:23 Polling...
D: 17-09-15 22:49:26 Done.
D: 17-09-15 22:49:26 zpoller_wait() is null
D: 17-09-15 22:49:26 zpoller_expired() is false
D: 17-09-15 22:49:26 zpoller_terminated() is false

I was expecting expired to return True.



-- 
- Justin



More information about the zeromq-dev mailing list