import socket
s = socket.socket()
s.connect(('127.0.0.1', 80))
s.send('Primal Security \n')
执行以上代码的时候会报错
错误内容:Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\新建文本文档.txt", line 3, in <module>
s.connect(('127.0.0.1', 80))
File "D:\Python27\lib\socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 10061]
1
nomaka 2015-02-13 13:01:25 +08:00
本机80端口没服务起来 windows下是10061错误 linux下多数是111错误
|
2
Any9aby OP - -80端口是开启的可以确定。用telnet 127.0.0.1 80 是开放的
|