zeromq/zeromq3-x — pull request #20 by kaka11chen (2012-07-13 07:52:26+00:00)
Title: tcp_connecter.cpp didn't handle the interrupted connect.

From the source code of zeromq, I think tcp_connecter.cpp didn't handle the interrupted connect.
From Unix Network Programming Volume1 3rd edition
Page75:
Interrupted connect
What happens if our call to connect on a normal blocking socket is interrupted, say, by a caught signal,
before TCP's three-way handshake completes? Assuming the connect is not automatically restarted, it
returns EINTR. But, we cannot call connect again to wait for the connection to complete. Doing so will
return EADDRINUSE.
What we must do in this scenario is call select, just as we have done in this section for a nonblocking
connect. select returns when the connection completes successfully (making the socket writable) or
when the connection fails (making the socket readable and writable).
Therefore if I am right, the following is the patch for zeromq-3.2.0-rc1, if it is ok, I can pull a request buy git-hub if necessary,
thanks!

Kaka Chen
kaka11.chen@gmail.com