Re: AsyncSockets connection timeout
Re: AsyncSockets connection timeout
- Subject: Re: AsyncSockets connection timeout
- From: Dustin Voss <email@hidden>
- Date: Wed, 19 Apr 2006 18:33:13 -0700
On 19 Apr 2006, at 4:49 PM, Yorh wrote:
Hi to all,
I'm using Async sockets class and I have a question about the first
connection method connectToHost: onPort: .
I know that I can set a custom timeout when I read or write data...
but sometimes the first connection takes several seconds, and I
would like to set the connection timeout shorter (about 10 seconds).
Is there any way to do it?
I think Async sockets use the system settings, but don't know how
to change it.
Thank you all for support
Yorh
According to the header files, Apple's sockets don't seem to support
a connection timeout option. And anyway, the place where such an
option would be used is hidden within
CFStreamCreatePairWithSocketToHost().
What I suggest is, you set up a NSTimer with the timeout you want.
When that timer fires, if the socket hasn't connected, call -
disconnect. That should abort the process.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden