C# FTP : How to Check time out and abort session
I currently built c# application using winscp to synchronize FTP Server to my local dir.
In C#, the session is connected to FTP server.
when comes to do directory listing using session.ListDirectory("/"), it keep stuck in the command looping and reconnect. I am sure the error is "NO Listing Directory".
this is because I set the FTP mode to passive and the firewall not accepting.
now the case is how can I test and check/trigger the timeout connection for keeping connect listing directory and abort the session to prevent the stuck in session.ListDirectory("/") command forever.
how to set the timeoutexception command in c#?
I found no example.
Thank you.
In C#, the session is connected to FTP server.
when comes to do directory listing using session.ListDirectory("/"), it keep stuck in the command looping and reconnect. I am sure the error is "NO Listing Directory".
this is because I set the FTP mode to passive and the firewall not accepting.
now the case is how can I test and check/trigger the timeout connection for keeping connect listing directory and abort the session to prevent the stuck in session.ListDirectory("/") command forever.
how to set the timeoutexception command in c#?
I found no example.
Thank you.