title: Zeromq multiple subscribers
body: <p>I am trying to send a video stream from one program to an arbitrary number of clients (like 0-10 clients)</p>
  <p>I can easily do this with one publisher and one subscriber, but if i start another client app it will not start recieving any data until i close the first one.</p>
  <p>My code looks like this:<br />
  <em><strong>SERVER</strong></em></p>
  <pre class="lang-py prettyprint-override"><code>import zmq
  import imageio
  import simplejpeg
  
  
  context = zmq.Context()
  publisher = context.socket(zmq.PUB)
  publisher.connect(&quot;ipc:///tmp/v4l&quot;)
  
  
  
  gif = imageio.get_reader('video.mp4')
  
  while True:
      for frame in gif:
          frame = simplejpeg.encode_jpeg(frame)
          publisher.send(frame)
  </code></pre>
  <p><em><strong>Client</strong></em></p>
  <pre><code>import zmq
  context = zmq.Context()
  subscriber = context.socket(zmq.SUB)
  subscriber.bind(&quot;ipc:///tmp/v4l&quot;)
  subscriber.setsockopt(zmq.SUBSCRIBE, b'')
  i = 0
  while True:
      data = subscriber.recv()
      print(i)
      i = i+1
  </code></pre>
  <p>in the documentation (<a href="https://learning-0mq-with-pyzmq.readthedocs.io/en/latest/pyzmq/patterns/pubsub.html" rel="nofollow noreferrer">https://learning-0mq-with-pyzmq.readthedocs.io/en/latest/pyzmq/patterns/pubsub.html</a>) it states</p>
  <blockquote>
  <p>Scenario #2 is more known, general pattern where multiple subscribers
  subscribes to messages/topics being published by a publisher.
  though i cannot figure out why this does not work for me.</p>
  </blockquote>