Read Me About SimpleReach.txt

Read Me About SimpleReach
=========================
1.1
 
SimpleReach is a demonstration of the System Configuration framework asynchronous network reachability API, which lets you determine whether a particular host is reachable and monitor reachability changes.
 
It's important that you understand that, when this API says that the host is reachable, it means that nothing on *this* computer will prevent you from connecting with the host.  Factors that are external to this computer may still prevent you from connecting.
 
SimpleReach requires the System Configuration framework asynchronous network reachability API, which was introduced with Mac OS X 10.3.  Earlier versions of System Configuration framework had a synchronous network reachability API.  That API is not covered by this sample.
 
Packing List
------------
The sample contains the following items:
 
o Read Me About SimpleReach.txt -- This file.
o SimpleReach.c -- Source for the program.
o SimpleReach.xcodeproj -- An Xcode 2.1 project for the program.
o SimpleReach.xcode -- An Xcode 1.1 project for the program.
 
Using the Sample
----------------
To try out SimpleReach, just run it from the command line, providing a list of DNS names as its arguments.
 
% ./SimpleReach www.apple.com
t = kSCNetworkFlagsTransientConnection
r = kSCNetworkFlagsReachable
c = kSCNetworkFlagsConnectionRequired
C = kSCNetworkFlagsConnectionAutomatic
i = kSCNetworkFlagsInterventionRequired
l = kSCNetworkFlagsIsLocalAddress
d = kSCNetworkFlagsIsDirect
 
Hit ^C to exit.
16:48:46 trc---- www.apple.com (from main)
16:48:46 ------- www.apple.com
16:49:53 trc---- www.apple.com
16:49:53 ------- www.apple.com
16:49:55 tr----- www.apple.com
16:50:18 trc---- www.apple.com
16:50:18 ------- www.apple.com
16:50:31 -r----- www.apple.com
 
SimpleReach will run and print any changes in the network reachability of the named hosts.  You must use ^C to quit it.
 
Building the Sample
-------------------
The sample was built using Xcode 2.1 on Mac OS X 10.4.  You should be able to just open the project and choose Build from the Build menu.  This will build the SimpleReach command line tool in the "Build" directory.
 
How it Works
------------
For each DNS name on the command line, SimpleReach uses the System Configuration framework asynchronous network reachability API to:
 
o create an instance of the SCNetworkReachabilityRef type (SCNetworkReachabilityCreateWithName) for each DNS name,
 
o schedule its callback on the runloop (SCNetworkReachabilitySetCallback, SCNetworkReachabilityScheduleWithRunLoop), 
 
o get and print the current reachability (SCNetworkReachabilityGetFlags), and 
 
o print the reachability whenever its callback is called.
 
Credits and Version History
---------------------------
If you find any problems with this sample, mail <dts@apple.com> and IÕll try to fix them up.
 
1.0 (Apr 2004) was the first shipping version.
 
1.1 (Jul 2005) was updated to include an Xcode 2.1 project to produce a universal binary; there were no code changes required for it to run correctly on the Developer Transition Systems.
 
Share and Enjoy.
 
Apple Developer Technical Support
Networking, Communications, Hardware
 
21 Jul 2005
 
$Log: Read\040Me\040About\040SimpleReach.txt,v $
Revision 1.2  2005/07/21 14:51:06  eskimo1
Updated for version 1.1.
 
Revision 1.1  2004/04/28 16:26:29  eskimo1
First checked in.