使用 WinINet 时被动 FTP 超时

发布于 2024-08-10 20:16:12 字数 400 浏览 1 评论 0原文

我尝试使用被动 ftp 来 ftp 文件,但在调用 put 命令时出现超时 (12002)。

我可以在其他 ftp 站点上使用被动 ftp,但不能在这个新站点上使用。

我在同一台服务器上使用三种不同的方式尝试过:

  • FileZilla 客户端处于被动模式 - 这有效
  • 被动模式下的 WinINet 库 - 调用 PutFile 时出现超时
  • IE 6 处于被动模式 - 尝试列出目录时出现超时

这是在 Windows 2000 服务器上。

我认为自从 FileZilla 工作以来我的防火墙设置正确。

谁能帮我弄清楚发生了什么事吗?

I'm trying to ftp a file using passive ftp but I get a timeout (12002) when the put command is called.

I'm able to use passive ftp with other ftp sites but not this new one.

I've tried this using three different ways on the same server:

  • FileZilla Client in passive mode - this works
  • WinINet libarary in passive mode - I get a timeout when calling PutFile
  • IE 6 in passive mode - I get a timeout when the directory listing is attempted

This is on a Windows 2000 server.

I assume my firewall is set up correctly since FileZilla worked.

Can anyone help me figure out what's going on?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

绝情姑娘 2024-08-17 20:16:12

在被动模式下,FTP 服务器在其一端打开一个端口,并告诉 FTP 客户端它需要连接的 IP/端口。在客户端,它创建一个新的套接字,将其绑定到本地IP/端口(通常是随机IP/端口,除非另有配置),并连接到服务器指定的IP/端口。如果没有实际看到网络数据包嗅探器(如 Wireshark)的跟踪日志,那么我猜测客户端的防火墙/路由器正在阻止出站连接,或者服务器端的防火墙/路由器正在阻止入站连接。 FileZilla 顺利通过这一事实可能意味着连接两端的 IP/端口对恰好与接受两端连接的所有防火墙/路由器规则相匹配,而 WinInet/IE IP/端口对中的某些内容是反而被拒绝。不过,这有点不寻常,因为被动模式往往比主动模式对防火墙/路由器更友好。您是否尝试过使用 Windows 命令行 ftp.exe 实用程序来查看它是否有效?顺便说一句,IE 的所有连接都使用 WinInet。

In Passive mode, the FTP server opens a port on its end and tells the FTP client the IP/Port it needs to connect to. On the client end, it creates a new socket, binds it to a local IP/Port (usually a random IP/Port unless configured otherwise), and connects to the server's specified IP/Port. Without actually seeing a trace log from a network packet sniffer, like Wireshark, then I would guess that either a firewall/router on the client end is blocking the outbound connection, or a firewall/router on the server end is blocking the inbound connection. The fact that FileZilla is getting through OK probably means that the IP/Port pairs on both ends of the connection happen to match all the firewall/router rules for accepting connections on both ends, whereas something in the WinInet/IE IP/Port pairs is getting rejected instead. That is a little unusual since Passive mode tends to be more firewall/router friendly than Active mode, though. Have you tried using Windows' command-line ftp.exe utility to see if it works or not? BTW, IE uses WinInet for all of its connections.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文