[zeromq-dev] Disconnecting from permanently dead endpoints

Martin Lucina martin at lucina.net
Thu Jan 26 02:10:06 CET 2012


Hi Pierre,

On Wed, 25 Jan 2012 16:25:59 +0100
Pierre Ynard <linkfanel at yahoo.fr> wrote:

> I want to set up a messaging system where a zeromq socket connects to
> several endpoints (with TCP). Some of these endpoints may go permanently
> down, and the corresponding transport addresses could even be reused
> by a totally unrelated service. So I need to a way to "disconnect" the
> zeromq socket from this endpoint, as keeping around zombie endpoints to
> periodically try to reconnect to them is unnecessary, undesirable and
> does not scale.

Understood.

> The only way I see to do this is to close the socket,
> create a new one, and reconnect it to all the remaining endpoints, but
> that's quite suboptimal. Did I overlook something?

Correct, recreating the socket is the only way to accomplish
what you need right now.

An API for zmq_disconnect() and zmq_unbind() would probably not be
controversial, but the implementation would be ... hard. This dives
right in to the termination mechanisms in libzmq which are really
complex.

-mato
-- 
Martin Lucina <martin at lucina.net>



More information about the zeromq-dev mailing list