[zeromq-dev] zyre and zmq_poll problem

Sridhar Anandakrishnan sxa17 at psu.edu
Thu Sep 11 14:04:00 CEST 2014

Hi, I am trying to poll on a zyre socket and it returns immediately with errno set to 88.

zyre version is 1.1.0 and libzmq is 4.1.0
Here is the output of the code (snippet below):
zyre: 1 1 0
zmq: 4 1 0
I: 14-09-10 11:01:57 (pine07) JOIN group=GLOBAL
zmq_poll err, 88

If I use zpoller the poller works properly for the zyre socket alone, but according to the docs, in order to use both a zmq socket and a file descriptor, I need to use zmq_poll()...

Any help appreciated.

serfd opens /dev/null in this case for testing...

    zyre_version(&major, &minor, &patch);
    fprintf(stderr, "zyre: %d %d %d\n", major, minor, patch);
    zmq_version(&major, &minor, &patch);
    fprintf(stderr, "zmq: %d %d %d\n", major, minor, patch);  

    zyre_t *node = zyre_new("pine07");
    //zyre_set_name(node, "pine07");
    ret = zyre_start(node);
    zyre_join(node, "GLOBAL");

    zsock_t *nodesock = zyre_socket(node);

    zmq_pollitem_t items[] = {
    		{ NULL, serfd, ZMQ_POLLIN, 0},
		{ nodesock, 0, ZMQ_POLLIN, 0}
    int npoll = sizeof(items) / sizeof(items[0]);
    int timeout = 60000; // FIXME - define?

    while(1) {
    	static char *sender, *ipaddr, *base = NULL, *hdr, *name;
    	char *msgstring;
    	zmsg_t *msg;
    	ret=zmq_poll(items, npoll, timeout);
    	if(ret<0) {
    		fprintf(stderr, "zmq_poll err, %d\n", errno);

More information about the zeromq-dev mailing list