Reputation: 6377
My application needs continuous network connectivity. I'm currently using Apple's "Reachability" class to check reachability at the start of the app.
I need to poll the network in order to check its functionality. What's the good practice to achieve this?
Upvotes: 1
Views: 447
Reputation: 58458
You shouldn't need to poll if you're using the Reachability class. You should be able to set a callback / delegate method on the reachability monitor and get notified when reachability changes.
Something like this:
SCNetworkReachabilitySetCallback(reachability, networkChangedListener, &context);
where 'networkChangedListener` is your callback function. This will be called whenever reachability changes, and from there you can post a notification to let interested parties know.
Upvotes: 1