It's incorrect to call connect() twice. Try this: Call connect() on the non-blocking TCP socket and expect it to return -1 and to set errno to EINPROGRESS. Then select() the socket for writing. When select() indicates that the socket is ready for writing, check the status of the asynchronous connect() using getsockopt() with SO_ERROR. If there's nothing accepting the connection, then getsockopt() should give you ECONNREFUSED.
Dado
_______________________________________________ Do not post admin requests to the list. They will be ignored. Macnetworkprog mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/macnetworkprog/archive%40mail-archive.com This email sent to [email protected]
