Getting a fair bit of Time Outs from Socket Stream :(

May 19, 2014 at 9:59 AM
Hi,

I'm trying to use this library to do LOTS of FTP stuff (we process about 3000-5000 files a day). And i'm hitting our FTP server every minute .. well.. i have a minute break between 'workloads' .. where an ftp workload can go for 30 seconds to a few mins, based on the files i need to process.

ANYWAYS, the start of my workload is this.
  1. Get all folders in root folder.
  2. for each folder, get all files in child folder.
  3. process stuff.
And i'm getting lots of Time Outs trying to get GetListing in the first step.

here's a stack trace....
at System.Net.FtpClient.FtpSocketStream.Read(Byte[] buffer, Int32 offset, Int32 count) 
at System.Net.FtpClient.FtpSocketStream.ReadLine(Encoding encoding) 
at System.Net.FtpClient.FtpClient.GetReply() 
at System.Net.FtpClient.FtpClient.Execute(String command) 
at System.Net.FtpClient.FtpClient.GetWorkingDirectory() 
at System.Net.FtpClient.FtpClient.GetListing(String path, FtpListOption options) 
at XXXX.FtpClientWrapper.GetFolders() in c:\Projects\XXXX\FtpClientWrapper.cs:line 255 
at XXXX.FtpClientWrapper.GetFileNames() in c:\Projects\XXXX\FtpClientWrapper.cs:line 60 
at XXXX.FtpListingsScheduleWorker.d__6.MoveNext() in c:\Projects\XXXX\FtpListingsScheduleWorker.cs:line 94

Exception Message: Timed out trying to read data from the socket stream!
and some code ....
private IList<FtpListItem> GetFolders()
{
    var content = _ftpClient.GetListing("/");  // <-- line 254
    if (content == null || 
        !content.Any())
    {
        return null;
    }
I'm connecting to a Filezilla server. here's the settings (which I'm happy to change if required)...

Image

Do you have any suggestions about what I can do? This is killing me :(