diff --git a/Frends.FTP.ListFiles/Frends.FTP.ListFiles/ListFiles.cs b/Frends.FTP.ListFiles/Frends.FTP.ListFiles/ListFiles.cs index aad28c8..1648c48 100644 --- a/Frends.FTP.ListFiles/Frends.FTP.ListFiles/ListFiles.cs +++ b/Frends.FTP.ListFiles/Frends.FTP.ListFiles/ListFiles.cs @@ -29,8 +29,8 @@ public static async Task ListFiles([PropertyTab] Input input, [PropertyT { try { - using var client = CreateFtpClient(connection); - + using FtpClient client = CreateFtpClient(connection); + await client.ConnectAsync(cancellationToken); if (!client.DirectoryExists(input.Directory)) @@ -51,7 +51,7 @@ public static async Task ListFiles([PropertyTab] Input input, [PropertyT catch (SocketException) { throw new ArgumentException("Unable to establish the socket: No such host is known."); - } + } } private static FtpClient CreateFtpClient(Connection connect)