[zeromq-dev] Disconnecting from permanently dead endpoints
john skaller
skaller at users.sourceforge.net
Thu Jan 26 07:50:19 CET 2012
On 26/01/2012, at 2:54 PM, Martin Lucina wrote:
>
> I would go with just calling unbind() or disconnect()
> with the char* you originally passed to bind() or connect().
That's exactly what I said :)
>
> 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.
You may be right, however that's not what my spec says:
when you disconnect you are disconnecting a SET of endpoints.
This is because connect/bind can be called with a char* to a buffer
which can be memcpy() into with the end point name. So all such
endpoints have the same char* address.
So since you're disconnecting a SET .. well there's nothing wrong
with an empty set!
Instead, the number of matched endpoints is returned by the function.
The client can then decide if 0 is an error or not.
--
john skaller
skaller at users.sourceforge.net
More information about the zeromq-dev
mailing list