Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: How to check internet connectivity?

  1. #1
    Junior Member
    Join Date
    Dec 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question How to check internet connectivity?

    Hi Frnds,
    I wanna to write a prog to check whether internet is

    connected or not.
    I tried using URL api or pinging Google
    but in both the cases i was not satisfied with the

    solution.


    can anyone provide me any other way to solve this prob.


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: How to check internet connectivity?

    Why were you not satisfied with the solution?

    You could try opening a file you know exists on the internet, that way if you can't open it, you know you aren't connected?

  3. #3
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,895
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: How to check internet connectivity?

    There are 2 things that need to work in order to have a "valid" internet connection:

    Your side must be connected, and the server side must be connected. Opening up a webpage or a socket connection is the best way to verify that both sides work. In particular, you should try opening a socket/webpage that you want to connect to in the first place.

Similar Threads

  1. Replies: 4
    Last Post: December 30th, 2010, 06:04 AM
  2. Web Service - Client - WORK OVER INTERNET
    By nikos in forum Java Networking
    Replies: 7
    Last Post: October 19th, 2010, 10:44 AM
  3. Help regarding JDBC connectivity in JSP
    By Lovable_Kumar in forum JDBC & Databases
    Replies: 0
    Last Post: May 30th, 2010, 11:53 AM
  4. Read XML from Internet Hang
    By yupingliew in forum Java Networking
    Replies: 8
    Last Post: November 9th, 2009, 09:49 AM
  5. Internet Filter to display some website
    By sundarjothi in forum JavaServer Pages: JSP & JSTL
    Replies: 1
    Last Post: May 15th, 2008, 05:03 AM

Tags for this Thread