I want it
I want it :D
session.Open(options);
Thread.Sleep(TimeSpan.FromMinutes(2)); // this is staging SFTP server and it has 90 seconds session idle timeout (live server has 30 minutes)
session.RemoveFiles("/winscp.log");
20/10/2016 13:13:30: winscp> option batch on
20/10/2016 13:13:30: batch on
20/10/2016 13:13:30: reconnecttime 120
20/10/2016 13:13:30: winscp> option confirm off
20/10/2016 13:13:30: confirm off
20/10/2016 13:13:30: winscp> option reconnecttime 120
20/10/2016 13:13:30: reconnecttime 120
20/10/2016 13:13:30: winscp> open "sftp://test1:pass1@ip:22" -hostkey="key" -timeout=15
20/10/2016 13:13:30: Searching for host...
20/10/2016 13:13:30: Connecting to host...
20/10/2016 13:13:31: Authenticating...
20/10/2016 13:13:31: Using username "test1".
20/10/2016 13:13:31: Authenticating with pre-entered password.
20/10/2016 13:13:32: Authenticated.
20/10/2016 13:13:32: Starting the session...
20/10/2016 13:13:32: Session started.
20/10/2016 13:13:32: Active session: [1] test1@ip
20/10/2016 13:13:32: winscp> pwd
20/10/2016 13:13:32: /
20/10/2016 13:15:32: winscp> rm -- "/winscp.log"
20/10/2016 13:15:32: Network error: Software caused connection abort
20/10/2016 13:15:32: Can't get attributes of file '/winscp.log'.
20/10/2016 13:15:32: Session 'test1@ip' closed.
20/10/2016 13:15:32: No session.
session.Open(options);
Thread.Sleep(TimeSpan.FromMinutes(2));
session.ListDirectory("/");
20/10/2016 12:51:02: winscp> option batch on
20/10/2016 12:51:02: batch on
20/10/2016 12:51:02: reconnecttime 120
20/10/2016 12:51:02: winscp> option confirm off
20/10/2016 12:51:02: confirm off
20/10/2016 12:51:02: winscp> option reconnecttime 120
20/10/2016 12:51:02: reconnecttime 120
20/10/2016 12:51:02: winscp> open "sftp://test1:pass1@ip:22" -hostkey="key" -timeout=15
20/10/2016 12:51:02: Searching for host...
20/10/2016 12:51:02: Connecting to host...
20/10/2016 12:51:03: Authenticating...
20/10/2016 12:51:03: Using username "test1".
20/10/2016 12:51:03: Authenticating with pre-entered password.
20/10/2016 12:51:04: Authenticated.
20/10/2016 12:51:04: Starting the session...
20/10/2016 12:51:04: Session started.
20/10/2016 12:51:04: Active session: [1] test1@ip
20/10/2016 12:51:04: winscp> pwd
20/10/2016 12:51:04: /
20/10/2016 12:53:04: winscp> ls -- "/"
20/10/2016 12:53:04: Network error: Software caused connection abort
20/10/2016 12:53:09: (A)bort, (R)econnect (5 s): Reconnect
20/10/2016 12:53:09: Searching for host...
20/10/2016 12:53:09: Connecting to host...
20/10/2016 12:53:11: Authenticating...
20/10/2016 12:53:11: Using username "test1".
20/10/2016 12:53:11: Authenticating with pre-entered password.
20/10/2016 12:53:11: Authenticated.
20/10/2016 12:53:11: Starting the session...
20/10/2016 12:53:11: Session started.
20/10/2016 12:53:11: -rw-r--r-- 1 test1 users 20170 Oct 5 12:45:09 2016 winscp.log
20/10/2016 12:53:11: D--------- 0 0 ..