Session.GetFiles when connection is lost

Advertisement

Raúl
Joined:
Posts:
2
Location:
Spain

Session.GetFiles when connection is lost

Hello,

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.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,285
Location:
Prague, Czechia

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:
https://winscp.net/eng/docs/library_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.

Reply with quote

Advertisement

You can post new topics in this forum