I'm writing an C# application (as a service) that connects to a FTP server and fetches all files in a named directory on the FTP-server. When I run it on my dev-machine (Windows 7) it works fine. But when I run it in the production server (Windows 2003)
it will hang in the stream reading command, se below. No exceptions will be thrown, it just hangs and consumes 15% of the cpu and the memory fluctates heavily between 100 and 250 meg.
Both dev and production uses the same dotnet version 3.5 and the assembly System.Net are identical on both machines. Both dev and production is 64 bit but the application is built in x86 (due to other dependencies).
It seems that the underlying windows API in W2003 makes this happen, or what do you think?
On the server I can connect to the FTP-server and list the files. When starting to read the file content it will hang, se my comments below.
Here is the core code:
cred = new NetworkCredential(username, password);
// list directory
FtpWebRequest request = (FtpWebRequest)WebRequest.Create(downloadUri);
request.Credentials = cred;
request.KeepAlive = false;
request.Method = WebRequestMethods.Ftp.ListDirectory;
View Complete Post