title: Improve WinSCP SCP connection time
body: <p>I'm currently trying to write client code in C# to transfer a 1kb file to a server using WinSCP. The following code works but the complete procedure takes approx 11 seconds. The code takes 10 seconds to negotiate the connection and authenticate the user. The actual file transfer happens very fast.</p>
  
  <pre><code>Process winscp = new Process();
  winscp.StartInfo.FileName = "winscp.com";
  winscp.StartInfo.Arguments = "/xmllog=\"" + "sftp.txt" + "\"";
  winscp.StartInfo.UseShellExecute = false;
  winscp.StartInfo.RedirectStandardInput = true;
  winscp.StartInfo.RedirectStandardOutput = true;
  winscp.StartInfo.CreateNoWindow = true;
  winscp.Start();
  
  // Feed in the scripting commands
  winscp.StandardInput.WriteLine("option batch abort");
  winscp.StandardInput.WriteLine("option confirm off");
  
  List&lt;string&gt; FtpCommands = new List&lt;string&gt;
  {
      string.Format("open scp://{0}:{1}@{2}:22",CONNECTION_SFTP_USER,CONNECTION_SFTP_PASSWORD, CONNECTION_SFTP_IP),
      string.Format("put \"{0}\" /home/pi/progs/programs/{1}", file, program),
      "exit"
  };
  
  LogMessage("Sending ftp commands");
  foreach (var ftpCommand in FtpCommands)
  {
      LogMessage(ftpCommand);
      winscp.StandardInput.WriteLine(ftpCommand);
  }
  
  winscp.StandardInput.Close();
  
  // Collect all output (not used in this example)
  string output = winscp.StandardOutput.ReadToEnd();
  
  // Wait until WinSCP finishes
  winscp.WaitForExit();
  </code></pre>
  
  <p>My code is an edited version of the "Full C# example" from the WinSCP website<br>
  <a href="https://winscp.net/eng/docs/guide_dotnet#csharp_example" rel="nofollow">https://winscp.net/eng/docs/guide_dotnet#csharp_example</a></p>
  
  <p>Without editing the server, is there any changes I could make to reduce the transfer time?</p>