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 6777085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:06:21+00:00 2026-05-26T16:06:21+00:00

Our application is sometimes timing out, we have a Java client connecting to a

  • 0

Our application is “sometimes” timing out, we have a Java client connecting to a unix daemon and for some reason it is now and again throwing the following error:

SocketException: Cannot establish connection to daemon
java.net.ConnectException: Connection timed out: connect
    at sun.nio.ch.Net.connect(Native Method)
    at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)
    at java.nio.channels.SocketChannel.open(Unknown Source)
    at ....
    at java.lang.Thread.run(Unknown Source)

This stack trace is from the following code:

  try
  {
    InetSocketAddress inetAddress = new InetSocketAddress(InetAddress.getByName(serverName), serverPort);
    socketChannel = SocketChannel.open(inetAddress); // <--- I think the problem is here
    pipeSck = socketChannel.socket();

  }
  catch (NoRouteToHostException e)//when the remote host cannot be reached or connection was refused
  {
    System.err.println("NoRouteToHostException: Cannot establish connection to daemon");
    e.printStackTrace();
    return 1; /* reply only with error */
  }
  catch (SocketException e)//when the remote host cannot be reached or connection was refused
  {
    System.err.println("SocketException: Cannot establish connection to daemon");
    e.printStackTrace();
    return 1; /* reply only with error */
  }

This works 99% of the time… any ideas why we are getting the timeout?

Thanks!

  • 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-26T16:06:22+00:00Added an answer on May 26, 2026 at 4:06 pm

    ‘Connection timed out’ means either that the network was temporarily down, which is the most likely, or, if it isn’t running on Windows, that the server’s socket backlog queue was full, which could happen under extreme load or denial-of-service attacks.

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

Sidebar

Related Questions

We are now testing our application with a few friends. Sometimes there are some
In our application we sometimes have to make minor GUI modifications for different customers:
Sometimes in order to make our application more responsive and fast, we use client
We have a desktop client with several hundreds of users in our company. Sometimes
We have an application that downloads some files in the background. Our application pops
On our web application, we have loads of attachments, some static (from DB) and
I have a J2EE java application which processes SOAP requests. In our production environment
Sometimes our application needs to draw very long strings (e.g. 6,000 chars) using ExtTextOut.
Recently, sometimes (rarely) when we export data from our application, the export log contains
Our application is interfacing with a lot of web services these days. We have

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.