Best practices for interpreting network reachability flags?
Best practices for interpreting network reachability flags?
- Subject: Best practices for interpreting network reachability flags?
- From: Rich Siegel <email@hidden>
- Date: Sun, 9 Sep 2007 17:51:08 -0400
Good afternoon,
I've written some code which schedules a
SCNetworkReachabilityRef and inspects the reachability flags
before attempting a recurring automatic network connection
(think "software update" or "email check"). I've been fairly
strict in interpreting the reachability flags: if (0 == (flags &
kSCNetworkFlagsReachable)) then I don't attempt to connect.
Unfortunately, I've been getting reports from beta sites saying
that their automatic connections aren't working, even though
they're connected. Typically this happens after a transition;
for example they were using an AirPort connection at the office,
put the laptop to sleep, brought it hope, woke it up, and
connected to their AirPort connection at home. A couple of sites
have reported refusal to connect after putting the laptop to
sleep at the office and waking it up at home, then plugging in
an Ethernet cable to use their home LAN.
I'm unable to reproduce any of these behaviors with the
resources available to me; but I'm wondering whether my
interpretation of the flags is overly strict. Would it be better
for me to assume that kSCNetworkFlagsReachable is only one of a
number of flags that indicate that it's worth attempting a
connection? I realize that with
kSCNetworkFlagsTransientConnection,
kSCNetworkFlagsConnectionAutomatic, or
kSCNetworkFlagsInterventionRequired that success isn't
guaranteed, but if I need to test those as well, I can do that.
Thanks for any advice...
R.
--
Rich Siegel Bare Bones Software, Inc.
<email@hidden> <http://www.barebones.com/>
Someday I'll look back on all this and laugh... until they
sedate me.
_______________________________________________
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