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 2 of 2

Thread: ping a host

  1. #1
    Junior Member
    Join Date
    Oct 2013
    Location
    Bulgaria
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb ping a host

    Thus I ping hosts

    import java.net.InetAddress;
     
    public class Main {
      public static void main(String[] args) throws Exception {
        InetAddress address = InetAddress.getByName("194.145.63.12");
     
        boolean reachable = address.isReachable(5000);
     
        System.out.println("Is host reachable? " + reachable);
      }
    }



  2. #2
    Member Helium c2's Avatar
    Join Date
    Nov 2023
    Location
    Kekaha, Kaua'i
    Posts
    117
    Thanks
    1
    Thanked 3 Times in 3 Posts

    Default Re: ping a host

    import java.net.InetAddress;
     
    public class Main {
      public static void main(String[] args) throws Exception {
        InetAddress address = InetAddress.getByName("194.145.63.12");
     
        boolean reachable = address.isReachable(5000);
     
        System.out.println("Is host reachable? " + reachable);
      }
    }
    So if I copy a class on this class file java on my chrome, they should have it also on the server I am on. I'm on verizon server. I'm using a router. my IP Address. It should show up on my computer then as an Pinged address. Just like the boxes that appear on my lower right screen of the chrome I'm on. That's the information box area they showed information on. Thanks...!

Similar Threads

  1. How to look up host ip
    By Vaderman2787 in forum Java Networking Tutorials
    Replies: 0
    Last Post: June 22nd, 2013, 06:00 PM
  2. Ping Between VLAN
    By Sudhakar Sekar in forum Java Networking
    Replies: 0
    Last Post: April 2nd, 2013, 01:37 AM
  3. Ping Pong Table - Issues with Scores
    By jshcamisado in forum What's Wrong With My Code?
    Replies: 14
    Last Post: February 15th, 2013, 06:11 PM
  4. DEBUG SMTP: could not connect to host "host.domain.uk", port: 25, response: 421
    By aueddonline in forum What's Wrong With My Code?
    Replies: 0
    Last Post: August 21st, 2012, 04:47 AM
  5. Replies: 15
    Last Post: July 2nd, 2012, 12:45 PM