在一个简单的聊天客户端的基础上工作,并得到以下错误:
socket.error: [Errno 10049] The requested address is not valid in its context
代码是:
from socket import *
HOST = ''
PORT = 8000
s = socket(AF_INET, SOCK_STREAM)
s.connect((HOST, PORT))
i = True
while i is True:
msg = raw_input("Write A MSG: ")
s.send(msg)
print "Awaiting reply"
reply = s.recv(1024)
print "Recived: ", repr(reply)
s.close()
感谢您的帮助。