java.net.ConnectException: Connection refused
Jelly Eclipse

Jelly Eclipse @jelly_eclipse_aa92116d069

About: java dveloper

Joined:
Feb 15, 2025

java.net.ConnectException: Connection refused

Publish Date: Feb 15
0 0

Three checks:
1) Run the Server code before running the Client code.
2)instead of this Socket clientSocket = new Socket("localhost", 5000);

do

Socket clientSocket = new Socket("127.0.0.1", 5000);

3)While hitting the url don't type "https://" type "http://"

Hope above might help the beginners those who are trying to connect client and server on the same computer

For those who are trying to connect to the other server rather than local

check for firewall blocking the connection or it might the listen backlog queue is full.

Comments 0 total

    Add comment