I'm trying to close my ftp connection to some ftp and it just hangs... forever!
- it only happens against 1 FTP server, so I'm assuming there's something bad setup with that server. Code works fine against other servers.
- only happens when the file I'm uploading is huge (180mb). Connection closes fine when file(s) are small.
- destination FTP server is running 220 ProFTPD 1.3.4a Server (Debian)
- For the large file, start time: 15:53:18.701. End time: 16:00:22.179; Roughly 7 mins.
- The 180MB file is 100% uploaded .. so it's when I'm trying to close the connection to complete the transfer and then continue in my code.
Here's the code:
using (var ftpStream = await ftpWebRequest.GetRequestStreamAsync())
{
await inputStream.CopyToAsync(ftpStream);
_loggingService.Debug("Closing service....");
ftpStream.Close();
_loggingService.Debug("Closed..");
}
Yes, I know I don't really need to call .Close();
because I'm in a using
statement but I did this to pinpoint to problem.