title: ZMQ Socket solution for a 1-to-1 two-way communication with connection re-establishment?
body: <p>I'm looking for a ZMQ-capable solution for a communication between an bound endpoint that is connected to 0 or 1 peers and no more than that. The communication is two-way, and the connection can be ended or severed at any point in time; and the connection can be re-establish with either a new peer or the same peer. It doesn't matter if the bound endpoint blocks or doesn't block if it doesn't have a peer on the other side.</p>
  
  <p>What ZMQ socket pair would suit this use case the best? I was initially thinking REP/REQ, but the socket pair allows for multiple REQs to connect to one REP, which I don't want; it also will need to handle the "I'm waiting for a recv/I'm going to send something" lockstep paradigm when someone disconnects. PAIR also seems bad because it doesn't naturally handle the reconnect, but it has the "0 or 1 peer" restriction I want. </p>
  
  <p>Any suggestions? </p>