title: Why doesn't zeromq work on localhost?
body: <p>This code works great:</p>
  
  <pre><code>import zmq, json, time
  
  def main():
      context = zmq.Context()
      subscriber = context.socket(zmq.SUB)
      subscriber.bind("ipc://test")
      subscriber.setsockopt(zmq.SUBSCRIBE, '')
      while True:
          print subscriber.recv()
  
  def main():
      context = zmq.Context()
      publisher = context.socket(zmq.PUB)
      publisher.connect("ipc://test")
      while True:
          publisher.send( "hello world" )
          time.sleep( 1 )
  </code></pre>
  
  <p>But this code <em>doesn't</em>* work:</p>
  
  <pre><code>import zmq, json, time
  
  def recv():
      context = zmq.Context()
      subscriber = context.socket(zmq.SUB)
      subscriber.bind("tcp://localhost:5555")
      subscriber.setsockopt(zmq.SUBSCRIBE, '')
      while True:
          print subscriber.recv()
  
  def send():
      context = zmq.Context()
      publisher = context.socket(zmq.PUB)
      publisher.connect("tcp://localhost:5555")
      while True:
          publisher.send( "hello world" )
          time.sleep( 1 )
  </code></pre>
  
  <p>It raises this error:</p>
  
  <blockquote>
    <p>ZMQError: No such device</p>
  </blockquote>
  
  <p>Why, can't zeromq use localhost interfaces?</p>
  
  <p>Does it only work on IPC on the same machine?</p>