[zeromq-dev] ZMQ_RCVTIMEO isn't enforced

Mos Yud mos.yud at gmail.com
Sun Jun 25 13:26:35 CEST 2017


2 questions:

1. I have one client and no server (no server is running). I also have the
following code:

*    zmq::context_t context(1);*

*    zmq::socket_t * client = s_client_socket(context);*

*    // set receive timeout*
*    int timeout = 10;*
*    int res = zmq_setsockopt(client, ZMQ_RCVTIMEO, &timeout, sizeof(int));*

s_client_socket(...) looks like this:

static zmq::socket_t * s_client_socket(zmq::context_t & context) {
    zmq::socket_t * client = new zmq::socket_t(context, ZMQ_REQ);

    //  Configure socket to not wait at close time
    int linger = 0;
    client->setsockopt(ZMQ_LINGER, &linger, sizeof(linger));

    return client;

After this code is activated, client is connected (even-though there is no
server listening).
Then i invoke socket.send(...) and the socket.recv(...),  and i get that
the recv is blocked and doesn't return after the timeout i set above.
Any suggestion for this issue?

2. Does ZMQ support named pipes for windows? I only found sockets, so
please correct if i am wrong here.

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

More information about the zeromq-dev mailing list