Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!news2.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!newsfe12.iad.POSTED!7564ea0f!not-for-mail
From: Walter Roberson <roberson@hushmail.com>
Organization: Canada Eat The Cookie Foundation
User-Agent: Thunderbird 2.0.0.17 (Windows/20080914)
MIME-Version: 1.0
Newsgroups: comp.soft-sys.matlab
Subject: Re: Check internet connection status using Matlab
References: <cd7fd4a0-a476-4290-a70d-696a8800d7bf@v72g2000hsv.googlegroups.com> <c562fa59-86ba-4fc0-98d3-dad9b19b5051@a70g2000hsh.googlegroups.com> <gdaqd3$lt0$1@fred.mathworks.com>
In-Reply-To: <gdaqd3$lt0$1@fred.mathworks.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 40
Message-ID: <kl6Kk.1126$YN3.855@newsfe12.iad>
NNTP-Posting-Host: 24.79.146.116
X-Complaints-To: internet.abuse@sjrb.ca
X-Trace: newsfe12.iad 1224274384 24.79.146.116 (Fri, 17 Oct 2008 20:13:04 UTC)
NNTP-Posting-Date: Fri, 17 Oct 2008 20:13:04 UTC
Date: Fri, 17 Oct 2008 15:13:16 -0500
Xref: news.mathworks.com comp.soft-sys.matlab:495894


Scott Burnside wrote:
> Jaime Zamora <jaime.zamora@gmail.com> wrote in message <c562fa59-86ba-4fc0-98d3-dad9b19b5051@a70g2000hsh.googlegroups.com>...
>> On Oct 17, 1:12=A0pm, "Matt Fig" <spama...@yahoo.com> wrote:

>> I would like to write a function that returns true if it's connected
>> to the internet.

> Crude, but it works:

> % This function returns a 1 if basic internet connectivity
> % is present and returns a zero if no internet connectivity
> % is detected.

> % define the URL for US Naval Observatory Time page
> url =java.net.URL('http://tycho.usno.navy.mil/cgi-bin/timer.pl');

And if I am the DNS administrator for your network, and I define
tycho.usno.navy.mil to resolve to one of the local machines, then
although you might detect that a connection was made, it would
not be an *internet* connection that had been detected.


You also didn't meet the specifications. The specification was not
whether "internet connectivity is detected", the specification
was whether it is "connected to the internet". For example if I were
the firewall administrator for your network and I had blocked all outgoing
http except to certain specific sites (e.g., allowed access to headquarter's
press releases but other sites permitted only upon -proof- that access
was required for your work), then because you would be "connected to
the internet", the function would be required to return true, even though
the function cannot contact USNO.


Sites *do* get blocked. Blocking many sites is a corporate legal requirement for
many companies -- for example, in many companies, blocking access to any
kind of nudity or sexuality is required, with the requirement sometimes imposed
by law (e.g., many US libraries are -required- to prevent minors from accessing
adult sites.) And then there are the legal requirements under 
Sarbanes-Oxley, which can require companies to block access to competitors
as elements of proof that they are not in collusion with the competitors...