title: How do I prevent ZeroMQ server accepting more than one connection?
body: <p>I have a ZeroMQ (PAIR) server but if more than one client connects to it the server crashes with the message:</p>
  
  <pre><code>Assertion failed: !inpipe &amp;&amp; !outpipe (pair.cpp:49)
  </code></pre>
  
  <p>How do I prevent this? My server code uses txzmq:</p>
  
  <pre><code>from txzmq import ZmqEndpoint, ZmqFactory
  from twisted.internet import reactor, protocol, task
  from txzmq.connection import ZmqConnection
  from zmq import constants
  
  class PairConnection(ZmqConnection):
  
      socketType = constants.PAIR
  
      # Send a message to the drone
      def messageSend(self, message):
          print "Sending:", message
          self.send(message)
  
      # Receive a message from the drone.
      def messageReceived(self, message):      
          print message
  
  factory_zmq = ZmqFactory()
  factory_zmq.protocol = PairConnection(factory_zmq, ZmqEndpoint("bind", "tcp://*:5500")) 
  reactor.run()
  </code></pre>