Title: Re: detecting an active Internet
connection
Nothing stops me from using SCNetworkCheckReachabilityByName(). I
was just experimenting with ping and wondered if I had missed
something. I suppose using it avoids linking against another
framework, but that is not a big deal. One place the ping way struck
me as useful would be in an AppleScript Studio application where it
would not be possible to use the other framework without going outside
AppleScript. In that case something like the following would
work:
try set pingResult to do shell
script "ping -c1 www.apple.com"
on error errMsg
display
dialog errMsg -- unkown host message will appear here
end try
pingResult
-------------------------------
"PING www.apple.com.akadns.net (17.112.152.32): 56 data
bytes
64 bytes from 17.112.152.32: icmp_seq=0 ttl=46 time=253.447 ms
On Mon, 25 Oct 2004 23:54:27 -0600,
Donald Hall <email@hidden> wrote:
> Looking back in the archives of this list, I have found several
schemes using
>
>
SCNetworkCheckReachabilityByName()
>
> to attempt to determine if the Internet was reachable without
> actually triggering a connection attempt.
>
> It seems to me that using "ping" through an NSTask
would also work. When I try
>
> ping -c1 www.apple.com
I would consider using SCNetworkCheckReachabilityXXX() a much more
'reliable' (wrong word, but something goes there) method than
hard-coding in a ping command and parsing the output.
Is there anything that is stopping you from using
SCNetWorkCheck...?
-Phil
--
Donald S. Hall, Ph.D.
Apps & More Software Design, Inc.
email@hidden
http://www.appsandmore.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/email@hidden
This email sent to email@hidden