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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:48:08+00:00 2026-06-10T15:48:08+00:00

I am trying to make a socket connection to an ip:port and it all

  • 0

I am trying to make a socket connection to an ip:port and it all works correctly on one of my computers. The client first connects to the server with a socket connection to log in; after that it expects incoming connections from the server and they are successful.

But, when I tried it on another computer, the client made the first connection to log in successfuly, and then waited for incoming connections. On the server side where the connections would be initiated I got this message:

java.net.NoRouteToHostException

and the incoming connection failed.

Why would that happen? Could it be a firewall issue?

s = new Socket(id, 4446);
BufferedWriter out1 = new BufferedWriter(new OutputStreamWriter(s.getOutputStream()));
BufferedReader in1 = new BufferedReader(new InputStreamReader(s.getInputStream()));

thats the 46-th line

java.net.NoRouteToHostException: No route to host: connect
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(Unknown Source)
        at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
        at java.net.PlainSocketImpl.connect(Unknown Source)
        at java.net.SocksSocketImpl.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.<init>(Unknown Source)
        at java.net.Socket.<init>(Unknown Source)
        at sample_server.doComms.run(doComms.java:46)
        at java.lang.Thread.run(Unknown Source)
  • 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-06-10T15:48:10+00:00Added an answer on June 10, 2026 at 3:48 pm

    As stated in the API:

    Signals that an error occurred while attempting to connect a socket to a remote address and port. Typically, the remote host cannot be reached because of an intervening firewall, or if an intermediate router is down.

    You most likely have a firewall or something blocking the connection. Try disabling one if you have one real quick, and see how that works. If it doesn’t work, it’s something else (the full stacktrace may help as comments on your question say).

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

Sidebar

Related Questions

Class c extends thread static Queue<Socket> socketQueue Make connection to another server or client
I am trying to make a socket.io based server but whenever I connect by
I am trying to make a simple server/client program pair. On LAN they work
I'm trying to make a little client-server script like many others that I've done
I am trying to make a simple Client-Server application but when I execute the
I'm trying to make a simple http client server using java. It will show
I've recently gotten into trying to make server-client connections. I was able to make
Through java applet I am trying to get socket connection from a client to
Have been struggling all day trying to make this simple example work using socket.io.
I'm trying to make my server more stable. It uses the server socket and

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.