English 中文(简体)
Passive FTP Timeout while using WinINet
原标题:

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?

问题回答

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.





相关问题
Why running a service as Local System is bad on windows?

I am trying to find out the difference between difference service account types. I tumbled upon this question. The answer was because it has powerful access to local resources, and Network Service ...

Programmatically detect Windows cluster configuration?

Does anyone know how to programatically detect that a Windows server is part of a cluster? Further, is it possible to detect that the server is the active or passive node? [Edit] And detect it from ...

get file icon for Outlook appointment (.msg)

I ve read Get File Icon used by Shell and the other similar posts - and already use SHFileInfo to get the associated icon for any given extension, and that works great. However, Outlook uses ".msg" ...

Identifying idle state on a windows machine

I know about the GetLastInputInfo method but that would only give me the duration since last user input - keyboard or mouse. If a user input was last received 10 minutes ago, that wouldn t mean the ...

Terminating a thread gracefully not using TerminateThread()

My application creates a thread and that runs in the background all the time. I can only terminate the thread manually, not from within the thread callback function. At the moment I am using ...

热门标签