我有一台运行绑定到 0.0.0.0:8000 的 Python XMLRPCServer 的 Windows XPSP3 机器,但是当我尝试通过地址 127.0.0.1:8000 上的 httplib HTTPConnection 进行连接时,我收到 socket.connection 错误,errno 10107(未知错误) .
C:\Documents and Settings\Matt>netstat -ano
Active Connections
Proto Local Address Foreign Address State PID
TCP 0.0.0.0:135 0.0.0.0:0 LISTENING 940
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING 4
TCP 0.0.0.0:3306 0.0.0.0:0 LISTENING 1244
TCP 0.0.0.0:8000 0.0.0.0:0 LISTENING 3624
TCP 0.0.0.0:10049 0.0.0.0:0 LISTENING 1184
TCP 127.0.0.1:1028 0.0.0.0:0 LISTENING 2644
TCP 192.168.80.132:139 0.0.0.0:0 LISTENING 4
UDP 0.0.0.0:445 *:* 4
UDP 0.0.0.0:500 *:* 696
UDP 0.0.0.0:1025 *:* 1096
UDP 0.0.0.0:4500 *:* 696
UDP 127.0.0.1:123 *:* 1040
UDP 127.0.0.1:1900 *:* 1252
UDP 192.168.80.132:123 *:* 1040
UDP 192.168.80.132:137 *:* 4
UDP 192.168.80.132:138 *:* 4
UDP 192.168.80.132:1900 *:* 1252
C:\Documents and Settings\Matt>python
Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> import httplib
>>> h1 = httplib.HTTPConnection('127.0.0.1:8000')
>>> h1.connect()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\httplib.py", line 757, in connect
self.timeout, self.source_address)
File "C:\Python27\lib\socket.py", line 571, in create_connection
raise err
socket.error: [Errno 10107] A system call that should never fail has failed
>>> h1 = httplib.HTTPConnection('192.168.80.132:8000')
>>> h1.connect()
>>>
编辑:它在代码块中,但我忘了实际提及它。如果我尝试通过机器的 IP 地址 (192.168.80.132) 连接,则连接成功。
有关更多上下文,这实际上发生在 Cuckoo Sandbox Analyzer.py 脚本的实例中,但我已经能够重新创建上述错误,所以我认为这不是 Cuckoo 的问题,而是 Windows 套接字. 感谢您对此提供的任何帮助。