包含下面是我目前使用的代碼:不工作的Python套接字連接正確
soc1 = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
ADDR = (HOST,PORT)
soc1.connect(ADDR)
soc1.send('WILL SEND')
運行上面的代碼時,我收到錯誤消息是:
Traceback (most recent call last):
File "C:\workspace\wx_python_test\chat_server.py", line 25, in <module>
soc1.connect(ADDR)
File "C:\Python27\lib\socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 10061]
任何人都可以請解釋我正在經歷的問題以及我如何糾正它?
完整的源代碼:http://pastie.org/4245314