• 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
Reachability redux: what about the user experience?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Reachability redux: what about the user experience?


  • Subject: Reachability redux: what about the user experience?
  • From: Rich Siegel <email@hidden>
  • Date: Mon, 27 Apr 2009 11:57:50 -0400

Good morning,

On 9/9/07 at 5:51 PM, email@hidden (Rich Siegel) wrote:

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.

Note the date on that. :-) Since then, I've had pretty good luck in sorting out SCNetworkReachability and making good use of it. However, there remain some cases in which things are a little fuzzy.


My latest issue is a case reported by a beta site: he has a single Ethernet interface configured (he says :-)) and when his machine is unhooked from the wire, my scheduled network activities are attempted, even though they shouldn't be. I have logging code in place, and when he unhooks the wire, a log entry gets created:

    2009-04-26 15.26.21 Redacted[176] Reachability transition for
    host redacted.example.com: flags 0x7 (reachable,  transient)

When he plugs the wire back in:

    2009-04-26 15.34.00 Redacted[176] Reachability transition for
    host redacted.example.com: flags 0x2 (reachable)

Now, clearly there's a bug in my logging code, because 0x7 is really (kSCNetworkFlagsTransientConnection | kSCNetworkFlagsReachable | kSCNetworkFlagsConnectionRequired). But since kSCNetworkFlagsReachable is set, I go ahead and try the connection anyway, and of course it fails.

The documentation doesn't provide much guidance on how network reachability and user experience should relate (which I guess makes sense, since it's probably application-dependent). But for me the big question is: how do reachability and user experience relate? Today, if the host is reachable, I try to connect. But clearly, reachability as reported by the API isn't the only determinant - should I only try to connect if kSCNetworkFlagsConnectionRequired is not set?

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


  • Follow-Ups:
    • Re: Reachability redux: what about the user experience?
      • From: Allan Nathanson <email@hidden>
  • Prev by Date: Re: Does CFNetwork proccess http response code 101 internel?
  • Next by Date: Re: Reachability redux: what about the user experience?
  • Previous by thread: Adding extra DNS records with CFNetService?
  • Next by thread: Re: Reachability redux: what about the user experience?
  • Index(es):
    • Date
    • Thread