[zeromq-dev] socket option for number of subscriptions

Jon Dyte jon at totient.co.uk
Sat Aug 28 15:44:38 CEST 2010


Hi

I am considering adding a new socket option, in order to get the number 
of subscriptions on the sub side socket.

This is because in the dynamic subscribe/unsubscribe scenario it is
possible to receive a message whilst in a loop


 while (true)
 {
        zmq::message_t msg;
        sm.recv(&msg);
        // do an unsubscribe of last remaining subscription for this socket

       // whoops return to the loop and we will block forever
}
    
If we could query the number of subscriptions from the socket,
the program could terminate cleanly.

Thoughts?

Jon




More information about the zeromq-dev mailing list