• 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-establishing networking on wake from sleep
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re-establishing networking on wake from sleep


  • Subject: Re-establishing networking on wake from sleep
  • From: John Timmer <email@hidden>
  • Date: Sun, 16 Mar 2003 17:03:35 -0500

Greetings -

I've got an app that catches a wake from sleep event, and tries to update
some network information shortly thereafter. In order to give the computer
a bit of time to wake up everything needed to network, I've added a
"sleep()" call to stall for a bit. For whatever reason, even sleeping for
10 seconds before checking whether the network is accessible doesn't seem to
allow enough time. The code I use to check for network accessibility is
taken straight from some Apple sample code:

result = NO;
if ( SCNetworkCheckReachabilityByName([[NSString
stringWithString:@"www.some_server.com"] cString], &flags) ) {
result = (flags & kSCNetworkFlagsReachable);
}
return result;

This code works fine when the computer is fully awake. This is mostly being
done with a DHCP-based configuration - is the problem that I need a bit of
time to pick up my configuration, or that the code above won't force DHCP to
do its magic?

Any advice is appreciated,

John
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Synchronize timer with internal clock (From: Chris Kane <email@hidden>)

  • Prev by Date: Re: cocoa-dev digest, Vol 2 #2075 - 16 msgs
  • Next by Date: Re: State of Cocoa adoption
  • Previous by thread: Re: Synchronize timer with internal clock
  • Next by thread: Re: Synchronize timer with internal clock
  • Index(es):
    • Date
    • Thread