Home Forums .NET libraries Xceed SFTP/FTP for .NET download single file threaded

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

    Hi,

    Is your FTP Component capacle of downloading a single file threaded?

    I am thinking of for example downloading a.zip.

    Connection 1 download the file from byte 1 to byte 1000.
    Connection 2 download the file from byte 1001 to byte 2000.
    Connection 3 download the file from byte 2001 to byte 3000.
    and so on..

    In oreder to speed up the transfer of file fast.

    Or is there a way?

    THANKS
    IANIAN

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

    User (Old forums)
    Member
    Post count: 23064

    This is an interesting concept however, Xceed Ftp library is not considered thread safe. We have not tested Xceed Ftp for .NET in this type scenario however the library does allow you to specify an offset when using the ReceiveFile method. The ftp server would also have to accept multiple connections, I’m just not certain how the library would react to multiple threads accessing the same data. I would be curious to know if any of our Xceed Ftp user have ever attempted this?

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

    User (Old forums)
    Member
    Post count: 23064

    Hi,

    Thanks for the answer.
    However why do you say that Exceed FTP is not thread safe? what is the reason why do you say so?

    Thanks.

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

    User (Old forums)
    Member
    Post count: 23064

    I think I will try offset.. But how can I say that it should limit the downloading of file at a particular pointer of file?
    Since I want to try downloading it more thn 2 threads.

    And using only offset I think It will overlap the downloading If I try more than 2 threads.
    The scenario I want is like this:
    Thread1 downloads Offset 0 Upto 1000
    Thread2 downloads Offset 1000 Upto 2000
    Thread3 downloads Offset 2000 Upto 3000

    I think this cannot be done in the receive file since it is only has parameter of Offset and no Limit.
    Am I right?

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

    User (Old forums)
    Member
    Post count: 23064

    The ReceiveFile method does not permit you to specify a limit. The only thing that you could do is to verify how many bytes have been received in the temporary destination file, and call Abort when it reaches the limit you want. Then you would have to read the exact number of bytes (e.g 1000) you want, and write (append) it to the final destination file.

    Note that this solution has not been tested, so I cannot guarantee that it will work.

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by André (had 5073 views)

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