
In the same case, checking for error by using getsockopt should be done when select returns, not after connect (man 2 connect).
In the same case, checking for error by using getsockopt should be done when select returns, not after connect (man 2 connect).