context.term hangs if used timeout on socket

Description

make basic c++ zmq client
set send and recv timeout
run client without server
send and recv command fails as expected
on context destructor code hangs in term method

Environment

windows, vs 2008

Attachments

1

Activity

Show:

Ian Barber September 18, 2012 at 6:38 AM

Yep, that's the ZMQ_LINGER option determining whether the socket should attempt to deliver the message.

Ernest September 13, 2012 at 7:47 AM

set ZMQ_LINGER option helps with this situation, probably not a bug

int linger = 0;
socket.setsockopt (ZMQ_LINGER, &linger, sizeof (linger));

Ernest September 12, 2012 at 4:07 PM

reproduced as well if remove timeouts and use non blocking send

try
{
zmq::message_t request(1);
socket.send (request, ZMQ_NOBLOCK);
}
catch( zmq::error_t t )
{
}

Ernest September 12, 2012 at 4:00 PM

reproduced on 3.2.0 as well

hangs on zmg::ctx_t::terminate()

// Wait till reaper thread closes all the sockets.
command_t cmd;
>>> int rc = term_mailbox.recv (&cmd, -1);

Won't Fix

Details

Assignee

Reporter

Labels

Components

Affects versions

Priority

Created September 12, 2012 at 3:49 PM
Updated August 29, 2013 at 4:33 PM
Resolved September 18, 2012 at 6:38 AM