[zeromq-dev] XPUB and unsubscribe notification message count (bug or not?)

Michael Haberler mail17 at mah.priv.at
Tue Nov 12 20:25:38 CET 2013


I'm puzzled by the following behaviour (trying to track subscriber count per topic):

XPUB server, XPUB_VERBOSE set
server tracks messages received on XPUB socket

single client:
client 1: SUB socket, connects to server, subscribes to 'topic' -> server receives subscribe message (\001topic)
client 1 exits: server receives unsubscribe message (\000topic) -  as expected.

multiple clients subscribing to same topic:

client 1: SUB socket, connects to server, subscribes to 'topic' -> server receives subscribe message (\001topic)
client 2: SUB socket, connects to server, subscribes to 'topic' -> server receives subscribe message (\001topic) 
client 1 exits: ---> no unsubscribe message received! (I would expect an unsubscribe message here)
client 2 exits: server receives unsubscribe message (\000topic)

Same situation with 3 clients: only the last unsubscribe generates a unsubscribe message

Is this as expected? Am I overlooking something? if not - happy to provide an example to reproduce, versions etc

thanks in advance

Michael




More information about the zeromq-dev mailing list