• 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: Using CFSocket to connect
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using CFSocket to connect


  • Subject: Re: Using CFSocket to connect
  • From: Mike Laster <email@hidden>
  • Date: Tue, 02 Jul 2002 14:55:49 -0400

On 7/2/02 2:53 PM, "Douglas Davidson" <email@hidden> wrote:

> On Tuesday, July 2, 2002, at 11:40 AM, Mike Laster wrote:
>
>> This is the part I'm confused about. If I have a timeout of say 5
>> seconds,
>> then the connect callback WILL be called in 5 seconds, whether the
>> connect
>> succeeded or failed, right? If I can count on getting this callback,
>> why do
>> I need to create ANOTHER timer to detect when I ran into the timeout?
>
> No. If you set a timeout of 5 seconds, the call to
> CFSocketConnectToAddress blocks, and returns within 5 seconds. If you
> want a callback, you set the timeout to a negative value; then
> CFSocketConnectToAddress returns immediately, and you get a callback (if
> you requested one).

Oops, I meant -5. If I use 5, I won't get a callback at all, since the
connect call will block.
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Using CFSocket to connect (From: Douglas Davidson <email@hidden>)

  • Prev by Date: Re: Using CFSocket to connect
  • Next by Date: Re: Using CFSocket to connect
  • Previous by thread: Re: Using CFSocket to connect
  • Next by thread: Re: Using CFSocket to connect
  • Index(es):
    • Date
    • Thread