Java.Net.Connectexception: Failed to Connect to /192.168.253.3 (Port 2468): Connect Failed: Econnrefused (Connection Refused)

java.net.ConnectException: failed to connect to /192.168.253.3 (port 2468): connect failed: ECONNREFUSED (Connection refused)

A connect failed: ECONNREFUSED (Connection refused) most likely means that there is nothing listening on that port AND that IP address. Possible explanations include:

  • the service has crashed or hasn't been (successfully!) started,
  • your client is trying to connect using the wrong IP address or port,
  • your client is trying to connect using a DNS name that resolves to the wrong IP, or
  • server access is being blocked by a firewall that is "refusing" on the server/service's behalf. This is pretty unlikely given that normal practice (these days) is for firewalls to "blackhole" all unwanted connection attempts.

Note that while you have an array variable called urls, it cannot contain real URLs. There is no overload of the Socket constructor that takes a real URL in any form. Indeed, if you supplied a URL in string form like this:

 new Socket("http://example.com", 42)

the result would be a different exception.
Likewise, if you attempt to connect to an IP address on a network that you can't route to (e.g. "a different WiFi network"), then you will get a different exception; e.g. "host not found", "no route to host" or "no route to network".

java.net.ConnectException: failed to connect to /192.168.1.107 (port 80) after 10000ms: isConnected failed: EHOSTUNREACH (No route to host)

I found the solution.
I disabled the Windows Defender Firewall ( In just private section where my network was active)

Failed to connect to shadowsocks client

ss-tunnel establishes a complete tunnel with ss-server, all traffic to ss-tunnel is directly relayed to ss-server without any SOCKS request/resolve processes.
After I've removed SOCKS handshake in my client program, it worked properly.

Unable to connect to other device via socket

Make sure that the server socket (receiver) run first and then run the sender socket (sender) means makes the starting difference between sender and receiver for 5 to 8 second if you run the sender socket first and then start the server socket this connection failed error could be come.

And sending the large file from java.io is not the good choice if you are using.Use the java.nio package for handling large file see this http://www.coderpanda.com/java-socket-programming-transferring-large-sized-files-through-socket/



Related Topics



Leave a reply



Submit