[zeromq-dev] Issue 504: Assertion failed at tcp_listener.cpp:58 (Win, WM)

Boris Gulay boris at boressoft.ru
Wed Feb 6 11:16:41 CET 2013


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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130206/b78dcf88/attachment.sig>


More information about the zeromq-dev mailing list