• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: AsyncSockets connection timeout
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >AsyncSockets connection timeout (From: Yorh <email@hidden>)

  • Prev by Date: Cheap replacement for bezierPathWithOvalInRect fill?
  • Next by Date: Re: Any tricks to dragging an NSTableView?
  • Previous by thread: AsyncSockets connection timeout
  • Next by thread: Cheap replacement for bezierPathWithOvalInRect fill?
  • Index(es):
    • Date
    • Thread