Re: Time out a connect() call
Re: Time out a connect() call
- Subject: Re: Time out a connect() call
- From: "Quinn \"The Eskimo!\"" <email@hidden>
- Date: Mon, 28 Feb 2011 23:29:44 +0000
On 28 Feb 2011, at 23:18, Nathan Sims wrote:
> Do you mean socket option SO_RCVTIMEO or is there one specifically for connect()? The reason I'm wanting to set it down so low is because it's for use on a dedicated intranet, and the destination is either there or it's not, so 5 to 10 seconds is generous in this case.
Rest assured we've heard that argument before. Let me outline the standard counter argument:
1. User hits connect.
2. User is curious as to why it hasn't connected quickly.
3. User looks around his office, notices his hub lights are all off.
4. User plugs in hub's power brick, which he'd accidentally kicked out.
At this point there are two potential outcomes:
A. The program immediately reconnects and User gets on with his work.
B. The program has timed out, and User has to manually hit the retry button, all the time cursing the program's author.
Personally I prefer outcome B (-:
ps The socket option you want is TCP_CONNECTIONTIMEOUT; see <x-man-page://4/tcp> for details.
S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden