title: SFTP Multiple Async Downloads using Tamir.Sharpssh
body: <p>I am working on a tool to download files from SFTP, 2 at a time. I am using Tamir.Sharpssh to connect to the SFTP, and I thought it would be do-able by using async and await. When I run the program, it finishes with no errors but I am not seeing any files downloaded.</p>
  
  <p>Below is my code, thank you in advance!</p>
  
  <pre><code>private async static void SFTPFileGetHelper()
  {
      try
      {
          Task&lt;String&gt; task1 = GetFileAsync(sftpFile1, localFile1);
          Task&lt;String&gt; task2 = GetFileAsync(sftpFile2, localFile2);
          await Task.WhenAll(task1, task2);
      }
      catch (Exception ex)
      {
          Console.WriteLine(ex.Message);
      }
  }
  
  public static Task&lt;String&gt; GetFileAsync(string remoteFilePath, string localFilePath)
  {
      return (Task.Run(() =&gt;
      {
          try
          {
              Sftp conn = new Sftp(Host, Username, Password);
              conn.Connect();
              conn.Get(remoteFilePath, localFilePath);
              conn.Close();
              return remoteFilePath;
          }
          catch(Exception ex)
          {
              return ex.Message;
          }
      }));
  }
  </code></pre>