Group Abstract Group Abstract

Message Boards Message Boards

0
|
8.4K Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:

How to test for internet connectivity from within a calculation

Posted 11 years ago
POSTED BY: David Reiss
4 Replies

Yes, when I do a ping in the terminal on OS X it runs without stopping until I do a control-c.

POSTED BY: David Reiss
Posted 11 years ago
POSTED BY: Bill Simpson

Hmmmm... if I turn off my WIFI I get:

In[3]:= Run["ping Google.com"]

Out[3]= 17408

But if I have it on, when I execute

Run["ping Google.com"]

it does not terminate and locks up the Kernel. Usually when one does a ping in a terminal it is a process that continues until one executes a control-c. I had to Kill my Mathematica to continue... the usual attempt to abort does not work in this case. So perhaps this is not quite a usable. ;-)

POSTED BY: David Reiss
Posted 11 years ago
Run["ping some.domain.name"]

seems to either return a 0 if it successfully gets a ping response or 1 if it fails.

POSTED BY: Bill Simpson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard