Programmers learn & share
0 votes
159 views

Problem :

Today I was testing Server and Client code on different machine. Both were on same Wi-fi network.

I created clients and got this exception for many threads :

java.net.ConnectException: Connection timed out: no further information

by (6.9k points)   | 159 views

2 Answers

0 votes

Solution :

This means your request did not get a response within some default time frame. The reasons that no response was received is likely to be one of:

a) The IP/domain or port is incorrect

b) The IP/domain or port (i.e service) is down

c) The IP/domain is taking longer than your default timeout to respond

d) You have a firewall that is blocking requests or responses on whatever port you are using

e) You have a firewall that is blocking requests to that particular host

f) Your internet access is down

by (36.1k points)  
edited by
0 votes

Solution:

The simple solution is to find out the actual reason of java.net.ConnectException: Connection refused, Possibly one of the reasons mentioned above and solve that. What is most important here is the approach of finding correct cause and solution. Here are some tips which may help you to identify real cause of  java.net.ConnectException: Connection refused:

1) First try to ping destination host, if the host is ping-able it means client and server machine are in the network.

2) Try connecting to server host and port using telnet. If you are able to connect means something is wrong with your client code. Also, by observing telnet output you will come to know whether the server is running or not or server is disconnecting the connection.

The more common reasons you'll see this error are:

  • You don't have a LearnToMod account. A LearnToMod account is necessary to access our Minecraft server.  To get a paid 1-yr subscription, go to www.learntomod.com
  • Your ip address outdated. The ips are designed to be temporary. Try pressing the Start Server button again on the server instances page to get a new ip.
  • You aren't using the correct version number of vanilla Minecraft. It's easy to change number versions if you have the right Minecraft launcher.
  • Your Minecraft launcher isn't from minecraft.net. More details on what will work are here. Any other vanilla Minecraft launchers are not compatible (such as: Team Extreme, Titan, the Windows 10 store version)
  • There may be too much data on your account. Larger sized worlds such as Imperial City can be slower to load. Try downloading a smaller-sized world such as Wizard's Tower or Vanilla Rainforest from the LearnToMod homepage. Here's how.
  • Incorrectly coded mods can sometimes lead to server connection problems. Check your account for rogue mods; check your mods for endless loops. Most importantly, each mod should have one function with the title main.

To Solve this issue

  • us.mineplex.com

  • gommehd.net

  • mc.hypixel.net

If you're unable to connect to other Minecraft servers then it's possible Mojang is undergoing server maintenance or experiencing a bug. It's also possible the problem is on your end -- there may be something that's blocking the connection or your internet connection is slow for some reason. Check your firewall, antivirus settings. It may be a temporary ISP issue as well. Resetting your internet router may kick start it into working again. 

Unplug it from the wall, wait at least 1 minute, and turn it back on again.  You'll have to wait for your router to fully re-connect to your ISP. This may take ten minutes or so. Then try joining the server again.

If you are able to connect to other Minecraft servers, then:

  • Mojang may be experiencing localized server problems 
  • The LearnToMod server may be down. Feel free to let us know about it,or check the Forums or the @LTMServerStatus twitter for updates. 
 

 

 
ago by (5.5k points)  
2,187 questions
2,514 answers
59 comments
241 users