Solved

intenet connectivity?

Posted on 2002-03-27
6
158 Views
Last Modified: 2010-03-31
i want to programatically check whether i am connected or not using JAVA?can somebody give a sample code for that?
0
Comment
Question by:anuj_roy
6 Comments
 
LVL 9

Accepted Solution

by:
Ovi earned 50 total points
Comment Utility
Serach at google for Ping.java. In other words, you must implement a simple ping to a predefined host.
0
 
LVL 92

Expert Comment

by:objects
Comment Utility
Not sure if there's a definitive way to check.
pinging as ovi suggested is probably the best solution, although if the machine you ping is down, or the net is slow (causing timeout) then the ping will fail making it appear that you are not connected when in fact you are.
0
 
LVL 3

Expert Comment

by:shyamkumarreddy
Comment Utility
Yes.
Can you explain. How is apps is.

Shyam
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 3

Expert Comment

by:msterjev
Comment Utility
boolean con=false;
try
{
     Socket s=new Socket("www.google.com",80);
     con=true;
     s.close();
}
catch(Exception e)
{
     con=false;
}

if(con)
{
   ................
}
0
 
LVL 9

Expert Comment

by:Venci75
Comment Utility
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Answered by: Ovi
Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Venci75
EE Cleanup Volunteer
0
 

Expert Comment

by:modulo
Comment Utility
Finalized as proposed

modulo

Community Support Moderator
Experts Exchange
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
countX 22 68
mapBully challenge 6 88
where is session ID cache stored 1 38
wordappend challenge 8 82
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now