Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7596095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:50:09+00:00 2026-05-30T21:50:09+00:00

I am trying to find out if specific hosts on my network are reachable.

  • 0

I am trying to find out if specific hosts on my network are reachable.
My java code is as follows:

InetAddress adr = InetAddress.getByName(host);
if(adr.isReachable(3000)){
    System.out.println(host + " is reachable");
}

This works quite well, however if I lower the timeout to say 500ms instead, it will not designate the host reachable anymore. I plan to check quite a few hosts in a loop, so having a low timeout is quite important. If I ping the host manually from the windows command line, it takes less than 10ms.

So why does the Java method need a much higher timeout to succeed?
Are there any alternatives to using isReachable()?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T21:50:11+00:00Added an answer on May 30, 2026 at 9:50 pm

    It depends on what you mean by reachability. If you only what do find reachable hosts listening on specific ports, you can open a socket connection to that port (for example, finding all HTTP servers by checking port 80). Using InetAddress.isReachable() is implementation dependent. According to the javadoc, “A typical implementation will use ICMP ECHO REQUESTs”. A “known port” check (like http(80), smb (445), etc.) using Java NIO (non-blocking I/O) can have higher performance. My company has a product that uses a “known port” scan to find boxes running Telnet or SSH, using NIO, and we can scan about 5000 IP/sec.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to find out if a date is between two specific dates or
I'm trying to find out if there is any way to find specific element
I am trying to find out how often a specific user has tweeted to/mentioned
I'm trying to find out if a specific MySQL User is still in use
I'm trying to find out if there is any way to elevate a specific
I am using windows OS. I am trying to find out whether a specific
Trying to find out if it's possible to use SQLAlchemy on Heroku. Thanks.
I trying to find out the visibility of the Excel and do some activities
I am trying to find out how to write an SQL statement that will
i m trying to find out how to convert timestamp date and time (

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.