Yes, you are right. I was setting the timeout directly in the GUI before establishing the connection in:
Advanced > Connection > Server response timeout > 1000 seconds
But instead, I need to set it in
# Setup session options
$sessionOptions = New-Object WinSCP.SessionOptions
$sessionOptions.Timeout = new-timespan -minutes 60 //added this line
With this change, my remote computer keeps verifying a 6GB file even after an hour of waiting.
There's no way the server takes this long to get the checksum on a 6GB file that I'm currently testing. (2GB files take around 30-60 seconds to complete).
Is it possible that this issue is more downstream with the remote server?
Tested on a machine that's in the same room/switch with the server.
The 6GB file that fails on the remote laptop, succeeds on this machine in about 2 minutes.
But, with the 18GB file, it fails after exactly 10 minutes (tried 3 times) with the error:
Remote side unexpectedly closed network connection
It does sound like the server or one of our firewalls is closing the connection. Will verify the logs and update.