I believe, it is a bug in 2.x branch. Issue in JIRA here: https://zeromq.jira.com/browse/LIBZMQ-504
Pull request here: https://github.com/zeromq/zeromq2-x/pull/77 Description of an issue: Imagine we have lost connection to other side. libzmq starts reconnect process. First connection attempt (made by zmq_connecter_t::start_connecting) calls tcp_connecter_t::open. Call to ::connect was unsuccessful (for example, we've got WSAECONNREFUSED = port is closed). In this case execution will pass to the end of tcp_connecter_t::open and we will have ECONNREFUSED in errno variable. In zmq_connecter_t::start_connecting, where we will return from tcp_connecter_t::open, execution will also pass to the end of it and reconnect timer will be activated. When time arrives zmq_connecter_t::timer_event will be called, that itself will call zmq_connecter_t::start_connecting from which tcp_connecter.open will be called. But this time we will have actual socked ID in s variable because it was not closed after previous connection attempt! In 3.x branch there is no such error because at the end of start_connections (just before enabling reconnect timer) close() method is called. Same should be done in 2.x branch.
signature.asc
Description: OpenPGP digital signature
_______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev
