I'm trying to run a server and a client on two separate Windows 7 machines on the same network using sockets in Python 2.7. First I'm just trying to get them to connect before trying to do anything.
Currently my server is:
import socket
host = '0.0.0.0' #Also tried '', 'localhost', gethostname()
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((host, 12345))
s.listen(5)
cs, addr = s.accept()
print "Connected."
My client is:
import socket
host = '127.0.0.1' #Also tried 'localhost', gethostname()
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(host, 12345)
print "Connected."
The error I get is:
socket.error: [Errno 10061] No connection could be made because the target machine actively refused it.
I've looked through lots of other questions but none of the answers solved my problem. Any help is appreciated.
When I use the IP address of the server (10.0.63.40) as the host for the client, I get
[Errno 10060] A connection attempt failed because the connected party did not properly
respond after a period of time, or established connection failed because connected host has
failed to respond