Re: Checking for internet connection?
Re: Checking for internet connection?
- Subject: Re: Checking for internet connection?
- From: Ben Dougall <email@hidden>
- Date: Sat, 14 Oct 2006 14:04:23 +0100
On Saturday, October 14, 2006, at 12:56 pm, Ben Dougall wrote:
From a while back on this list:
On 2/17/06 9:24 AM, "Paul J. Lucas" <email@hidden> wrote:
Is there any way to check to see if there is an active internet
connection?
- Paul
On Friday, February 17, 2006, at 05:41 pm, Greg Herlihy wrote:
I'm not sure about a Cocoa API, but Core Foundation's System
Configuration
Framework's "Reachability" API can tell you:
http://developer.apple.com/documentation/Networking/Conceptual/
SystemConfigF
rameworks/SC_ReachConnect/chapter_5_section_4.html
Greg
The two functions on that page, SCNetworkCheckReachabilityByAddress
and SCNetworkCheckReachabilityByName (regarding pre 10.3), checks the
availability of another external host. That's really the best way to
see if the computer has a connection? Check to see if say Amazon are
contactable and from that assume that the machine you're on has a
connection? That's really crap I reckon. Surely there's a reasonable
way to find out if the machine is currently connected to the net or
not (OS X 10.2+)?
In fact what I'd really like to know, is how to get the information you
can get via the Internet Connect app using AppleScript, e.g.:
{user name:"", server name:"", speed:115200, seconds connected:6028,
seconds remaining:-1, bytes received:28671527, bytes sent:13430858,
protocol:0, message:"", state:4}
Is there any way to get that information, particularly whether there's
a connection or not, speed, and seconds connected,
directly/programmatically without AppleScript and the need for Internet
Connect to open?
Thanks, Ben.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden