Post a reply

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)


Topic review


Re: Session.GetFiles when connection is lost

When connection is lost, WinSCP (.NET assembly) tries to reconnect the session for up to 120 seconds (by default). You can change that using Session.ReconnectTime:

If you believe it keeps trying indefinitely, please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate the session log file, set Session.SessionLogPath. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

I have solved the issue by using event OnQueryReceived.

Session.GetFiles when connection is lost


I have a software that, under user action, creates a thread and this thread calls to session.GetFiles. While performing this process, everything works fine.

But, in this situation, if the connection with the server is lost, for example by stopping the server or by disconnecting the network, the thread continues living because session.GetFiles doesn't finish. Also, if I try to call session.Close, this calling also is blocked and never ends.

I assume that it is not the expected result, but it is the one I'm experiencing. Can anyone confirm this is not normal? Can anyone clarify what should happen and what may is happening?

Thanks for your help.