I am testing my server and client with two computers.
This is my server:
And this is my problem:
This is my server:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
import socket server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.bind(( 'localhost' , 9090 )) server.listen( 1 ) copp, adr = server.accept() while True : letter = copp.recv( 2000 ) print ( str (letter)) copp.send(b 'asd' ) this is my client: import socket client = socket.socket() client.connect(( 'localhost' , 9090 )) client.send(b 'Yes' ) |
Error:Traceback (most recent call last):
File "C:\Users\Владелец\Desktop\Yes.py", line 3, in <module>
client.connect(('localhost', 9090))
ConnectionRefusedError: [WinError 10061] The connection is not established, since target computer rejected the connection request