Home Forums .NET libraries Xceed SFTP/FTP for .NET GetFolderContents – large directory…

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #20670 |

    I have a FTP directory with a large number of files, about 19k. When using either FTP for .NET verison 1.0.116, or 2.0, the function GetFolderContents seems to hang on this particular large folder, does not throw any type of exception, and never continues.

    Has anyone else experienced this type of problem?

    The file server is a Linux box, and the client using the .NET component is C# running on Windows XP SP1.

    Thanks,
    Scott

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by scott_merrill (had 8508 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi Scott.

    This may occur if retreiving the full listing takes more than the timeout value. If you set the Timeout property to a higher value (e.g. 60 seconds), do you see the end of the tunnel? Also, if you call GetRawFolderContents (no parsing), does it complete?

    If this server is accessible from the outside and you are willing to give us access to it, you may send an email to <mail>support@xceedsoft.com</mail> with the details.

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Martin (had 344 views)

    User (Old forums)
    Member
    Post count: 23064

    I too am suffering the same problem – only it is definitely not related to the number of files in the remote directory.

    I will give you a background of our application as it makes intensive use of the FTP class and therefore exposes any problems that arise with is.

    I have been evaluating your FTP for .NET component for a couple of weeks which we purchased last week. We are using it in a ‘mission critical’ service application that distributes work orders from a database to some 35 different FTP locations. We have a variety of hardware platforms and OS’s (AS400 Linux etc). The component appeard to be functioning well (I had previously written my own sockets class to perform the FTP but this proved to be unreliable) however we noticed that the service process appeard to ‘hang’ unexpectedly for no good reason. I attributed this to using System.Timers.Timer in my main service class (I read a few posts that this caould cause thread deadlocking)

    After rewriting the application to spaw a new thread explicity for my worker class (using a property in my class to indicate that the SCM had requested a service stop) we still experienced the ‘hangs’. After yet another rewrite I produced a version that writes debug messages to a ‘rolling’ logfile. The service has hung twice in the last 24 hours and I can see that my worker thread is being blocked by a call to the FtpClient.GetFolderContents method.

    I am convinced that my issue is not related to the number of files in the remote directory because the directory I send the files to is being monitored by a remote application and the files are ‘picked up’ pretty soon after delivery.

    My tests currently transmit @100 files/hour – which mimics the volume of production traffic. Does anyone have any suggestions – I am already behind in my release schedule – I can’t easily revert to using a COM dll as a lot of these use WININET (not supported for use in a service)

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by cblair (had 466 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi!

    Is it possible for you to send a sample application to <mail>support@xceedsoft.com</mail>?

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Martin (had 259 views)

    User (Old forums)
    Member
    Post count: 23064

    Sure no problem

    Here is the function that fails….

    The LogMessage function is for debug purposes and writes to a rolling log file. The last messages we got when the service fell over this morning are :- (log is appended to the top)

    02/15/05 07:44:07 : newFTP : FileExists – trying to Dir contents
    02/15/05 07:44:07 : newFTP : FileExists – testing to see if connected
    02/15/05 07:44:07 : newFTP : RenameFile – testing to see if file exists
    02/15/05 07:44:07 : newFTP : RenameFile – testing to see if connected
    02/15/05 07:44:07 : SweepVendor : ReceiptFTP – attempt to archive file – O71P1574.TST
    02/15/05 07:44:07 : newFTP : FileExists – found match with O71P1574.TST
    02/15/05 07:44:07 : newFTP : FileExists – checking list to find file match with O71P1574.TST
    02/15/05 07:44:07 : newFTP : FileExists – successfully got Dir contents
    02/15/05 07:44:07 : newFTP : FileExists – trying to Dir contents
    02/15/05 07:44:07 : newFTP : FileExists – testing to see if connected
    02/15/05 07:44:07 : SweepVendor : ReceiptFTP – test if file exists – O71P1574.TST

    public bool FileExists(string filename)
    {
    string FUNCTION_NAME = “FileExists”;
    FtpItemInfoList filelist;
    string name = “”;
    try
    {
    LogMessage(“FileExists – testing to see if connected”);
    if (!ftp.Connected)
    {
    throw new Exception(“FTP session disconnected – unable to check if file : ‘” + filename + “‘ exists”);
    }
    try
    {
    LogMessage(“FileExists – trying to Dir contents”);
    filelist = http://ftp.GetFolderContents(filename);
    LogMessage(“FileExists – successfully got Dir contents”);
    }
    catch (Exception ex)
    {
    return false;
    }
    LogMessage(“FileExists – checking list to find file match with ” + filename);
    foreach (FtpItemInfo Row in filelist)
    {
    name = Row.Name;
    if(name == filename)
    {
    LogMessage(“FileExists – found match with ” + filename);
    return true;
    }
    }
    LogMessage(“FileExists – did not find match with ” + filename);
    return false;
    }
    catch (Exception ex)
    {
    AddError( APP_ID, 2, FUNCTION_NAME, -1, ex.Message);
    return false;
    }
    }

    Looks like you have a block somewhere in the function call. CPU time is 0 on this process so there is not an endless loop – something is just waiting and there is no timeout. Please let me know of progress on this issue as I will need to find another component is resolution cannot be achieved within a couple of days.

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by cblair (had 443 views)

    User (Old forums)
    Member
    Post count: 23064

    Had the FtpClient.SendFile method lock up on me today as well as the GetFolderContents method. Looks like DotNet Sockets are not very robust with async calls.

    Anyhow, wasted enough time trying to get a robust solution – tech support wasn’t very helpful- going to exercise my ‘Money back’ option on this component and go down a different path.

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by cblair (had 409 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi Colin.

    That’s too bad you’re exercing your money back garantee, I was actually working on reproducing this issue. Are you sure you don’t want to give us a last chance?

    You’re tough on “good technical support”. We received your first email Monday afternoon, and as of this morming (Wednesday), it’s in my hands.

    I’m currently trying to reproduce your environment using two console apps / two services. My goal is to have more information before the end of the week. I’m sorry if I didn’t personally reply to your technical support email, I was under the impression that you agreed with Mathieu’s last reply.

    Anyway, I’ll spend the rest of the day on this. If you do not wish to be informed via the case ID we opened for you, I won’t insist.

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Martin (had 234 views)

    User (Old forums)
    Member
    Post count: 23064

    I am under pressure to get my solution out – to replicate the volume of traffic I am sending you need to send out about 100 files/hour 24/7.

    Your code is presumably relatively robust but I have read quite a few articles regarding the robustness of System.Net.Sockets in Async calls – this is where I would look.

    Regarding the support issue – I received and email implying that it wasn’t worth putting a developer onto the issue if I was not going to buy the product anyway. It was clear in my previous communications that at least one method call was producing a blocking thread (now I have discovered another) therefore somebody should have being investigating regardless of my intentions (this may just have been a communication misunderstanding)

    I am currently writing a wrapper for an old COM class I have for FTP – however I would prefer to use a pure managed code solution.

    Keep me posted on your progress

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by cblair (had 422 views)

    User (Old forums)
    Member
    Post count: 23064

    If you manage to figure out what is going on before I get my alternative solution working then you are still the preferred option.

    Like I said to Mathieu I am perfectly willing to try out a debug (logging) version of the component in our environment as I already have a high traffic/large variety of FTP servers environment here.

    I only experience one or two ‘blocks’ in a 24 hr period so replication for you may take a whole lot longer.

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by cblair (had 351 views)

    User (Old forums)
    Member
    Post count: 23064

    I am also getting this same problem in my application. Is this problem solved or not?

    Thanks in advance.

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Venkat (had 7290 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi Administrator,

    We are using the latest FTPClient. When getting the files using GetFolderContent() function sometimes its not responding at all. Since we are using thread its hanged. Please give suggestion to solve these kind of problems

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Saravanan (had 1672 views)

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.