title: How to handle multiple publishers on same port in zmq?
body: <p>This question has been asked before, <a href="https://stackoverflow.com/questions/24276128/how-should-i-handle-multiple-publishers-on-the-same-port-on-the-same-host">here</a>. I have the exact same problem. I want to publish from a bunch of different processes, and use the same port every time. </p>
  
  <p>I tried the solution presented in the answer, but this did not work for me. I get the error </p>
  
  <pre><code>    File "/usr/local/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
      self.run()
    File "/usr/local/lib/python2.7/multiprocessing/process.py", line 114, in run
      self._target(*self._args, **self._kwargs)
    File "/home/akay/afk/multi.py", line 18, in to_zmq
      socket.connect("tcp://*:%s" % port)
    File "zmq/backend/cython/socket.pyx", line 478, in zmq.backend.cython.socket.Socket.connect (zmq/backend/cython/socket.c:4308)
  ZMQError: Invalid argument
  </code></pre>
  
  <p>My code is like this, essentially taken straight from the example in the zmq docs <a href="http://zguide.zeromq.org/py:wuserver" rel="nofollow noreferrer">here</a> and <a href="http://zguide.zeromq.org/py:wuclient" rel="nofollow noreferrer">here</a>: </p>
  
  <pre><code># Socket to talk to server
  port = '5556'
  context = zmq.Context()
  socket = context.socket(zmq.SUB)
  print "Listening for stream...", m
  socket.bind("tcp://localhost:%s" % port) #change connect to bind, as per answer above
  socket.setsockopt(zmq.SUBSCRIBE, topicfilter)
  </code></pre>
  
  <p>I am using python 2.7, and the most recent version of zmq. Any idea what I might be doing wrong?  </p>