Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

t0r3x

t0r3x wrote:

martin wrote:

Disposing should help.
Please set Session.DebugLogPath, try and attach the log.


The order of events in my program is as follows. I start up a thread in the ThreadPool with session.GetFiles in it, then the thread keeps working until done downloading. When I want to cancel downloading, I do a session.Dispose on the same session object, but then it still keeps working until done with downloading. After that it does dispose, but only when done downloading. I dont quite know how to tackle this situation currently, so any tips or guidance would be greatly appreciated. To be sure I attached the log as you asked. Thanks.


The more I seem to try, the more Im starting to think its a limitation in the library. Like I said earlier, when I dispose it disposes but only after having finished with GetFiles. GetFiles therefore seems uninterruptable when being executed until finished. Do you have any more information about this yet? Thanks.
t0r3x

martin wrote:

Disposing should help.
Please set Session.DebugLogPath, try and attach the log.


The order of events in my program is as follows. I start up a thread in the ThreadPool with session.GetFiles in it, then the thread keeps working until done downloading. When I want to cancel downloading, I do a session.Dispose on the same session object, but then it still keeps working until done with downloading. After that it does dispose, but only when done downloading. I dont quite know how to tackle this situation currently, so any tips or guidance would be greatly appreciated. To be sure I attached the log as you asked. Thanks.
martin

Disposing should help.
Please set Session.DebugLogPath, try and attach the log.
t0r3x

Thats to bad, is there maybe some kind of workaround for at least an abort/cancel? It is absolutely critical that I can somehow terminate a download over the SCP protocol or else my entire implementation becomes useless and my solution will sadly fall apart.

I would guess disposing the session also terminates the WinSCP.exe on the background, but when I try to do that everything just hangs, probably because the connection stays in an open state. I have also been looking at doing things manually with the ExecuteCommand method, using the scp command, but couldnt get things going with the identity file yet (Windows/Unix paths). I dont know if it will even make a difference eventually, because it will basicly be the same command I have to send that terminates the download thread.

Like I said, a big part of my program is depending on the WinSCP .NET assembly. The program I am developing uploads files via RSync and downloads via WinSCP, for storing backups on a NAS box. The RSync wrapper has not been a problem, but all now seems to come down to cancelling the download thread and disposing the session via WinSCP. I cannot have a very big file not being able to abort with a download of lets say 200 kb/s, it would kill the usability of my application. So please, if you would know anything at all that could maybe help me achieving an abort/cancel it would be greatly appreciated and would help me tremendously. Thanks a million in advance.
martin

t0r3x wrote:

How would you cancel a transfer you are doing with WinSCP.Session.GetFiles then? Simply a dispose (does not seem to work when I checked real quick)?

Well, again, it is not possible.
t0r3x

How would you cancel a transfer you are doing with WinSCP.Session.GetFiles then? Simply a dispose (does not seem to work when I checked real quick)?
martin

Re: Pause/Resume File Transfer

No, it is not possible.
AvidApprentice

Pause/Resume File Transfer

Perhaps I am overlooking it but I cannot seem to find anything regarding pausing/resuming of file transfers. Does the .NET assembly currently have the ability to do this? If not is it on the road map?

Thanks