How to detect internet connection loss during transfer?
Hey everyone, I'm fairly new to WinSCP in .NET. I have been using SSH.NET so far, but I can't make it handle internet connection losses properly. And since WinSCP offers resuming file transfer after disconnection, I just HAD to try it :)
Currently I am testing a situation where a user would download 1 file only, while they are conencted through a VPN. Turning off the VPN doesn't seem to faze WinSCP as the download resumes after a while without issue. Yet turning all internet connections off (Wifi in this case) just makes the transfer stay on a lull, with no exceptions thrown or any prompt whatsoever.
My question is, is there a way where WinSCP can react to a complete internet connection loss? Or at least a disconnection from the server?
I have had a look (and tested) both
Any feedback is appreciated. Thanks in advance! :)
Edit: I use the SFTP protocol, if it helps.
Currently I am testing a situation where a user would download 1 file only, while they are conencted through a VPN. Turning off the VPN doesn't seem to faze WinSCP as the download resumes after a while without issue. Yet turning all internet connections off (Wifi in this case) just makes the transfer stay on a lull, with no exceptions thrown or any prompt whatsoever.
My question is, is there a way where WinSCP can react to a complete internet connection loss? Or at least a disconnection from the server?
I have had a look (and tested) both
Session.GetFiles()
and Session.GetFileToDirectory()
.
GetFiles
does have the Check()
method to throw any errors, but it does not seem to do anything.
Any feedback is appreciated. Thanks in advance! :)
Edit: I use the SFTP protocol, if it helps.