[zeromq-dev] ZMQ_RCVTIMEO isn't enforced
Luca Boccassi
luca.boccassi at gmail.com
Sun Jun 25 14:25:33 CEST 2017
On Sun, 2017-06-25 at 14:26 +0300, Mos Yud wrote:
> Hi,
>
> 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);
> client->connect("tcp://localhost:5555");
>
> // 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?
It works fine with just libzmq, so maybe try without the C++ bindings
> 2. Does ZMQ support named pipes for windows? I only found sockets, so
> please correct if i am wrong here.
It does not.
Kind regards,
Luca Boccassi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20170625/ac79917b/attachment.sig>
More information about the zeromq-dev
mailing list