• 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
Re: Check for an internet connection?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Check for an internet connection?


  • Subject: Re: Check for an internet connection?
  • From: "John C. Welch" <email@hidden>
  • Date: Mon, 24 Feb 2003 14:20:25 -0500

On 02/21/2003 09:33, "Mark Butcher" <email@hidden> wrote:

>
> On Thursday, Feb 20, 2003, at 17:37 US/Pacific, Andy Ihnatko wrote:
>
>> What's the simplest way to check if the internet is reachable? I'm
>> building a new version of my AS Studio blogger app. When the time
>> comes to post an item, I'd like it to be smart enough to say "You're
>> not connected to the 'net. Would you like to cache it for later?" if
>> necessary.
>>
>> For now, I call a shell script that pings the server, but I sense that
>> a better solution is out there. Ideas?

> This checks the status of Internet Connect:
>
> tell application "Internet Connect"
> state of (status of current configuration)
> end tell
> (*
> 0=idle
> 1=connecting
> 2
> 3
> 4=connected
> 5=disconnecting
> *)
>
> MarkB

However, that doesn't tell you anything other than Internet Connect has a
connection to *something. That something is the internal port on your cable
/ DSL modem, or your dialup provider. It will tell you nothing past that.
Oddly enough, your ping method is the best one to test if you have a
connection to the *Internet* and can see your server.

The only downside to this is of course that if you are traveling, many
places block pings. Nslookup isn't an option, as that tells you nothing
about status. A sample curl would be a better bet perhaps?

john


--
"We want to be in a situation under maximum pressure, maximum intensity, and
maximum danger. When it's shared with others, it provides a bond which is
stronger than any tie that can exist."
- SEAL Team Six Officer
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Check for an internet connection? (From: Mark Butcher <email@hidden>)

  • Prev by Date: Re: Newbie Questions: Error numbers - any complete reference available?
  • Next by Date: Dealing with lists
  • Previous by thread: Re: Check for an internet connection?
  • Next by thread: PDF Workflow scripts: /private/tmp/
  • Index(es):
    • Date
    • Thread