• 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
network configuration change notification
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

network configuration change notification


  • Subject: network configuration change notification
  • From: Michael Brian Bentley <email@hidden>
  • Date: Wed, 25 Nov 2015 10:47:28 -0800

Hi,

With the switch to NEHotspotHelper, I wonder if the following still works to indicate a network configuration change occurred? It indicates it is worth looking, instead of polling every few seconds.

CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), //center
                                    NULL, // observer
                                    onNetworkChangeCallback, // callback
CFSTR("com.apple.system.config.network_change"), // event name
                                    NULL, // object
CFNotificationSuspensionBehaviorDeliverImmediately);

static void onNetworkChangeCallback(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo)
{
    NSString* notifyName = (__bridge NSString*)name;

// this check should really only be necessary if you reuse this one callback method
    //  for multiple Darwin notification events

if ([notifyName isEqualToString:@"com.apple.system.config.network_change"]) {

        @autoreleasepool
        {
[[NSNotificationCenter defaultCenter] postNotificationName: kReachabilityChangedNotification object: nil];
        }
    }
}

_______________________________________________
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


  • Follow-Ups:
    • Re: network configuration change notification
      • From: "Quinn \"The Eskimo!\"" <email@hidden>
  • Prev by Date: Re: Integrating NSOutputStream and NSOperation
  • Next by Date: Can't discover bonjour service
  • Previous by thread: To "Turbo3" on the forums
  • Next by thread: Re: network configuration change notification
  • Index(es):
    • Date
    • Thread