We are currently using an open source SFTP client and it is giving us a lot of issues. Here's what we are trying to do.

We have a windows service that runs and monitors a remote directory on a Linux server via SFTP. When it finds files of a certain type it downloads those files. This service runs 24/7 and checks for these file types on a 1500ms interval. In the event of loss of network connectivity our solution will need to continuously retry until a connect can be re-established. In the event of a file lock, it also needs to support a retry mechanism, either implicitly or through events, error-handling, and/or custom code. The files range in size from 100k to 15mb and may be 10-20k files a day.

Can Rebex SFTP help us?

asked 10 Jan '11, 20:11

Gary's gravatar image

Gary
16
accept rate: 0%


Yes, I'm sure Rebex SFTP can help you. Although it doesn't support automated download retry or connection re-establish, these actions can easily be achieved by catching SftpException, checking its Status property and reacting accordingly.

In case of loss of network connectivity, the Status will be set to SftpExceptionStatus.ConnectionClosed. In case of a protocol error like a file lock, it will be set to SftpExceptionStatus.ProtocolError and SftpException's Code property can be used to determine what kind of SFTP protocol error occured.

10-12k files (100K to 15MB each) sounds like a lot. To get the highest speed out of Rebex SFTP, enable Sftp object's UseLargeBuffers option before connecting to the server:

sftp.Options |= SftpOptions.UseLargeBuffers; //(C#)

sftp.Options = sftp.Options Or SftpOptions.UseLargeBuffers; ' VB.NET

(where 'sftp' is an instance of Rebex.Net.Sftp)

This uses larger receive buffers at different levels (TCP/IP, SSH, SFTP), resulting in transfer speed increase.

link

answered 11 Jan '11, 10:14

Lukas%20Pokorny's gravatar image

Lukas Pokorny ♦♦
2.4k28
accept rate: 31%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×144

Asked: 10 Jan '11, 20:11

Seen: 344 times

Last updated: 22 Mar '11, 12:22