0

When there are many files in the remote directory often have session timeout problem, what's the default session time and if increase will be any side effects?

var allFiles = session.EnumerateRemoteFiles(folderIn, null, EnumerationOptions.None); 

Part of the error logs:

Timeout waiting for WinSCP to respond    
    at WinSCP.Session.CheckForTimeout(String additional)     
    at WinSCP.PatientFileStream.Wait(Int32& interval)     
    at WinSCP.PatientFileStream.Read(Byte[] array, Int32 offset, Int32 count)     
    at System.Xml.XmlTextReaderImpl.ReadData()
    at System.Xml.XmlTextReaderImpl.ParseText(Int32& startPos, Int32& endPos, Int32& outOrChars)
    at System.Xml.XmlTextReaderImpl.ParseText()
    at System.Xml.XmlTextReaderImpl.ParseElementContent()
    at System.Xml.XmlTextReaderImpl.Read()
    at WinSCP.SessionLogReader.DoRead()
    at WinSCP.SessionLogReader.Read(LogReadFlags flags)
    at WinSCP.ElementLogReader.Read(LogReadFlags flags)
    at WinSCP.SessionElementLogReader.Read(LogReadFlags flags)
    at WinSCP.ElementLogReader.Read(LogReadFlags flags)
    at WinSCP.CustomLogReader.TryWaitForNonEmptyElement(String localName, LogReadFlags flags)
    at WinSCP.CustomLogReader.WaitForNonEmptyElement(String localName, LogReadFlags flags)
    at WinSCP.Session.ListDirectory(String path)
    at WinSCP.Session.<DoEnumerateRemoteFiles>d__86.MoveNext()

WinSCP .NET assembly version 6.1.2

And any difference between the following two:

  1. setup the timeout in SessionOptions and use it when open the session
var sessionOptions = new SessionOptions
{ Timeout = new TimeSpan(0, 2, 0) };

or 2) open the session then set the timeout value?

session.Timeout = new TimeSpan(0, 2, 0);

1 Answer 1

0

As documented, the default value of Session.Timeout is one minute: https://winscp.net/eng/docs/library_session#timeout

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks. I've update the question and want to know the difference on setup the timeout value.
You cannot just change the question. If you have a new question, please post a new question.
OK, a new question added. [stackoverflow.com/questions/78260784/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.