[zeromq-dev] zmq_disconnect and zmq_close fails

Laurent Alebarde l.alebarde at free.fr
Thu Jan 30 19:25:05 CET 2014


Hi all,

I have a test that makes zmq_disconnect and zmq_close fail (in the frame 
of developments on libzmq itself, but besides that, all tests pass).


*Test 1:*
     void *worker = zmq_socket (ctx, ZMQ_DEALER);
     assert (worker);
     int linger_time = 100;
//    rc = zmq_setsockopt (worker, ZMQ_LINGER, &linger_time, 
sizeof(linger_time));
//    assert (rc == 0);
     rc = zmq_connect (worker, "inproc://backend");
     assert (rc == 0);

// do some stuff

     rc = zmq_disconnect (worker, "inproc://backend");
     printf("Error: zmq_disconnect failed: %s (%d)\n", 
zmq_strerror(errno), zmq_errno());
     assert (rc == 0);
     rc = zmq_connect (worker, "tcp://127.0.0.1:9999");
     assert (rc == 0);

The output is:
Error: zmq_disconnect failed: Resource temporarily unavailable (11)

Moreover, if I suppress this zmq_disconnect command and execute the next 
one which is a zmq_connect, it looks like it is not connected to the new 
address.

*Test 2:*
     void *worker = zmq_socket (ctx, ZMQ_DEALER);
     assert (worker);
     int linger_time = 100;
//    rc = zmq_setsockopt (worker, ZMQ_LINGER, &linger_time, 
sizeof(linger_time));
//    assert (rc == 0);
     rc = zmq_connect (worker, "inproc://backend");
     assert (rc == 0);

// do some stuff

     rc = zmq_close (worker);
     printf("Error: zmq_disconnect failed: %s (%d)\n", 
zmq_strerror(errno), zmq_errno());
     assert (rc == 0);
     void *worker = zmq_socket (ctx, ZMQ_DEALER);
     assert (worker);
     rc = zmq_connect (worker, "tcp://127.0.0.1:9999");
     assert (rc == 0);

The output is:
Error: zmq_disconnect failed: Resource temporarily unavailable (11)


If I add some linger time to the worker socket, it changes nothing.

To what I could read, this errno = 11 indicates Resource Temporarily 
Unavailable.

Any idea please ?

Laurent


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20140130/f73cbe7a/attachment.htm>


More information about the zeromq-dev mailing list