socket.error:[Errno 10061]无法建立连接,因为目标计算机主动拒绝它

时间:2015-05-28 18:27:05

标签: windows ftp

我想使用python在两台计算机之间传输文件。 我在客户端使用ftplib模块,在服务器端使用pyftpdlib。但是,我收到了错误" socket.error:[Errno 10061]无法建立连接,因为目标计算机主动拒绝它"。我的代码如下:

客户端代码:

from pyftpdlib import servers, handlers
address = ('', 21)  
server = servers.FTPServer(address, handlers.FTPHandler)
server.serve_forever()

服务器端代码:

[I 15-05-28 11:14:41] >>> starting FTP server on :::21, pid=8296 <<<
[I 15-05-28 11:14:41] poller: <class 'pyftpdlib.ioloop.Select'>
[I 15-05-28 11:14:41] masquerade (NAT) address: None
[I 15-05-28 11:14:41] passive ports: None

我运行服务器端代码并​​获取:

socket.error: [Errno 10061] No connection could be made because the target machine actively refused it

我运行客户端代码并获取:

socket.error: [Errno 10060] A connection attempt failed because the connected party did not properly respond after a per
iod of time, or established connection failed because connected host has failed to respond

我需要在目标计算机(服务器)上更改或检查哪些设置才能使其接受连接? (我的服务器是Windows Sever 2012R2,我的客户端是Windows 8)

更新: 我打开服务器的防火墙,然后重新运行客户端请求。现在我得到了一个不同的错误:


function main(splash)
    splash:go(splash.args.url)
    splash:runjs('document.getElementById["'.. splash.args.submit ..'"].click();')
    splash:wait(0.5)
    return splash:html()
end

0 个答案:

没有答案