In order to get the reason of connection fail from
kCFSocketConnectCallBack
, I must pass a negative number to CFSocketConnectToAddress
's timeout
parameter(like this: CFSocketConnectToAddress(self.socket, sin_cfd, -1)
). But I also want to set connection timeout. Do you know how to set connection timeout in this case?