EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Example Creating a Timeout for SFTP Commands

Also by EldoS: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.
Posted: 02/22/2008 03:41:11
by Michael Dunnigan (Basic support level)
Joined: 02/22/2008
Posts: 2


I would like to upload files to an SFTP site and if the "put" takes more than a configured amout of time I would like to cancel the operation. Could you post a simple example on how to do this using your libraries?


Posted: 02/22/2008 04:49:54
by Ken Ivanov (EldoS Corp.)

First, it's necessary to clarify what exactly does 'put' mean. Is it the whole upload operation or upload of a particular file chunk (as the file is actually uploaded chunk-by-chunk)?

Use OnProgress event to track the progress of the whole operation. Its Cancel parameter allows to terminate the transfer if needed. Use SocketTimeout property to specify the timeout for particular socket 'send' operation.

All the above concerns TElSimpleSFTPClient class.
Posted: 02/22/2008 07:20:05
by Michael Dunnigan (Basic support level)
Joined: 02/22/2008
Posts: 2

I was referring to the whole operation. Do you have a code sample for this case?


Posted: 02/23/2008 02:58:20
by Eugene Mayevski (EldoS Corp.)

We have no sample for such specific task, but if you look into SimpleSftp demo, you will find OnProgress event handler there. Setting Cancel parameter to true in that event handler will abort the operation. And it's your job to decide when to cancel.

Sincerely yours
Eugene Mayevski



Topic viewed 1855 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!