[zeromq-dev] Disconnecting from permanently dead endpoints

Martin Lucina martin at lucina.net
Thu Jan 26 04:54:15 CET 2012


On Thu, 26 Jan 2012 14:00:55 +1100
john skaller <skaller at users.sourceforge.net> wrote:

> 
> On 26/01/2012, at 12:32 PM, john skaller wrote:
> 
> > 
> > Isn't it also a design fault? I mean, if you can connect/bind to multiple endpoints dynamically
> > you obviously should be able to un-connect and un-bind.
> 
> API:
> 
> int disconnect(void *socket, void *connection);
> int unbind(void *socket, void *connection);

Yup, this is almost the same as what I was thinking.

> Semantics:
> 
> When you connect or bind a socket, 0MQ associates the char* address
> of the endpoint name with the internal representation of the endpoint.

"void *connection" won't work; you would then need to get a handle
for the internal representation of the endpoint out of libzmq when you
call connect() or bind(), in order to be able to call unbind() or
disconnect () on it.

I would go with just calling unbind() or disconnect()
with the char* you originally passed to bind() or connect().

Semantics are pretty much the same; it is obviously an error to unbind
() or disconnect() an endpoint which was not bound or connected in the
first place.

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



More information about the zeromq-dev mailing list