mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-23 08:31:46 +02:00
Problem: zmq_connect fails after disconnect due to RECONNECT_IVL == -1
Solution: when a connection breaks and ZMQ_RECONNECT_IVL is set to -1, which means a reconnection will not be attempted, send a message from the I/O thread to the application thread to make the socket call term_endpoint, which is the equivalent of manually calling zmq_disconnect. This way subsequent zmq_connect call to the same endpoint will attempt again to do a connection. Otherwise, for some socket types like SUBs, those new connects will fail as the endpoint is recorded, despite the connection having been permanently closed. Add test cases to exercise this corner case with TCP and IPC.
This commit is contained in:
@@ -1425,6 +1425,12 @@ void zmq::socket_base_t::process_term (int linger_)
|
||||
own_t::process_term (linger_);
|
||||
}
|
||||
|
||||
void zmq::socket_base_t::process_term_endpoint (std::string *endpoint_)
|
||||
{
|
||||
term_endpoint (endpoint_->c_str());
|
||||
delete endpoint_;
|
||||
}
|
||||
|
||||
void zmq::socket_base_t::update_pipe_options(int option_)
|
||||
{
|
||||
if (option_ == ZMQ_SNDHWM || option_ == ZMQ_RCVHWM)
|
||||
|
Reference in New Issue
Block a user