Errno 10061:No Connection Could Be Made Because the Target Machine Actively Refused It ( Client - Server )

Win Error 10061 No connection could be made because the target machine actively refused it

when I try to run the server and client on different computers I get an error on the clients end

That is because you are using127.0.0.1 on both sides. That is the localhost loopback IP address. It works when the client and server are on the same machine, but it is not routable on the LAN network.

You need to:

  • change the server to listen on either 0.0.0.0 (to listen on all installed network interfaces), or its actual LAN IP address (just the network interface attached to the LAN).

  • change the client to connect to the server's hostname or IP address on the LAN.

I have tried changing the port multiple times but it didn't help

The problem is nit with the port, but with the IP address.

(duplicate) [WinError 10061] No connection could be made because the target machine actively refused it

The meaning of this error is simple: it means that there is no server process on IP address 127.0.0.1 (your own computer) which is listening to port 8820.

If you want to connect to a port you must choose an IP address and port where there is a server running.

You were probably supposed to run a server program on your computer and then run this client program at the same time.

No connection could be made because the target machine actively refused it

It's because you haven't opened the port you are trying to connect to, nothing is listening there. If you're trying to connect to a web or ftp server, start it first. If you're trying to connect to another port, you need to write a server application too.



Related Topics



Leave a reply



Submit