Errno 10061 in python, I don't know what to do
I learned about sockets in python. When I tried to program the script sockets on the same computer it worked, but when I tried to program the script sockets with two different computers and open a socket with a connection it didn't work.
One computer (server):
import socket s = socket.socket() host = socket.gethostname() port = 1234 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()
Second computer (client):
import socket
s = socket.socket()
host = raw_input("The ip you want to connect to: ")
port = 1234
s.connect((host, port))
print s.recv(1024)
Mistake:
socket.error: [Errno 10061]
What is the problem with scripts? Why doesn't it work?
+3
source to share