[zeromq-dev] querying what a SUB socket is subscribed to

Körtesi Gáspár gazs at mcule.com
Tue Oct 25 12:31:57 CEST 2011


Hello,

is there a way to query what subscriptions a socket has? I'm using PyZMQ 
(2.1.10 with zmq 2.1.10), and I've tried getsockopt as suggested by the 
documentation, but I get the following error:

 >>> s.setsockopt(zmq.SUBSCRIBE, "foo")
 >>> s.getsockopt(zmq.SUBSCRIBE)
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "socket.pyx", line 331, in zmq.core.socket.Socket.getsockopt 
(zmq/core/socket.c:3202)
zmq.core.error.ZMQError: Invalid argument

What am I doing wrong?


Thanks,
Gaspar



More information about the zeromq-dev mailing list