title: ZeroMQ REQ/REP server error handling
body: <p>I am trying to use the ZeroMQ rep/req and cannot figure out how to handle server side errors. Look at the code from <a href="https://learning-0mq-with-pyzmq.readthedocs.org/en/latest/pyzmq/patterns/client_server.html" rel="noreferrer">here</a>: </p>
  
  <pre><code>socket.bind("tcp://*:%s" % port)
  while True:
      #  Wait for next request from client
      message = socket.recv()
      print "Received request: ", message
      time.sleep (1)  
      socket.send("World from %s" % port)
  </code></pre>
  
  <p>My problem is what happens if the client calls socket.send() and then hangs or crashes. Wouldn't the server just get stuck on socket.send() or socket.recv() forever?</p>
  
  <p>Note that it is not a problem with TCP sockets. With TCP sockets I can simply break the connection. With ZMQ, the connections are implicitly managed for me and I don't know if it is possible to break a 'session' or 'connection' and start over.</p>