python server-client program
I get this error on the client program side only
client program
import socket
c= socket.socket(socket.AF_INET, socket.SOCK_STREAM)
c.connect(('localhost', 50000))
c.sendall(b"hello world")
c.close()
print(c)
-> errorConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it
server program
import socket
s = socket.socket()
host = socket.gethostname()
port = 50000
s.bind((host, port))
s.listen(5)
while True:
c, addr = s.accept()
print('Got connection from', addr)
c.send('Thank you for connecting')
c.close()
used many different ports same error
tried turning the firewall off
ran it as an administrator
same error help please