Login  
Search All Forums
Dart Home | PowerTCP FTP for .NET | Custom Development Reply | PowerTCP FTP for .NET Topics | Forums   
AuthorForum: PowerTCP FTP for .NET
Topic: Application freezing during List() and Get()
dhonda

From: Brea, CA USA
Posts: 8
Member Since: 04/15/05
posted May 6, 2005 1:27 PM


Hello All,

- Ftp.net 2.2.5.0
- Running on Windows 2000 Server
- C# code
- Running Synchronously
My application tends to get frozen at two places on several different ftp sites.
The first is when I am doing a list() on a series of directories(1K+).
No exception is generated, no processor spike, just a process that isn't doing
anything. The second occurs when I am downloading files (10K+).
The Get() command will start writing a file, but never finish. I can't delete
the file because it still has a lock on it. No exceptions are thrown. Any ideas
on how I can isolate and resolve this issue?
Thanks,
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted May 9, 2005 10:19 AM

Is there any way that you can help us duplicate this issue? Do you have a server that you can give us access to that will reproduce it regularly?

Barring that, you could use the Trace event to create a log and then check the log to see if it gives you any clues.
dhonda

From: Brea, CA USA
Posts: 8
Member Since: 04/15/05
posted May 9, 2005 11:12 AM

Can the trace event be used with the synchronous methods? Do you have examples (other than the Online help) of how I could integrate the logging. Thanks
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted May 9, 2005 11:15 AM

Yes. Take a look at the FTP ListView sample app. The sample has an option to create a log file.
dhonda

From: Brea, CA USA
Posts: 8
Member Since: 04/15/05
posted June 10, 2005 11:52 AM

Finally got to log the entire process. These are the last few relevant lines in the log.
>C->PORT 172,16,4,46,5,149
>S<-200 PORT command successful.
>C->RETR /photo/70/190/509_0.jpg
>S<-150 Opening BINARY mode data connection >for /photo/70/190/509_0.jpg(51137 bytes).
>S<-226 Transfer complete.
>S<-421 Timeout (900 seconds): closing control >connection.
>S<-421 Terminating connection.
Now my dartftp object is set with the following timeouts:
dartFtp.Connection.ConnectTimeout = 5000;
dartFtp.Timeout = 60000;
So I imagine that the 900 is the default timeout from the server. Would this timeout raise an event that my try{}catch{} should detect?
TIA
- D
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted June 10, 2005 12:46 PM

You should get a ConnectedChanged event when the server sends the timeout message. I just tried with the sample ListView client and it works OK.
dhonda

From: Brea, CA USA
Posts: 8
Member Since: 04/15/05
posted June 15, 2005 11:17 AM

I have tried the following function to try and kill the hung ftp transfer when I get a timeout. Unfortunately it didn't seem to work. When I try to delete the file that it was in the process of downloading, I get the "process still in use error". Could you please suggest another way for me to get the ftp object to release or end the current ftp transfer?

private void ConChange(object sender, System.EventArgs e)
{
 if(!dartFtp.Connected)
 {
  dartFtp.Connection.Close();
 }
}
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted June 15, 2005 11:47 AM

Please send the exact steps to duplicate the problem with our sample FTP app to support@dart.com and we continue this via email.

smudger

From: London, United Kingdom
Posts: 2
Member Since: 08/08/05
posted August 8, 2005 10:50 AM

Did anything come out of this because I think i am experiencing the same problem?
dhonda

From: Brea, CA USA
Posts: 8
Member Since: 04/15/05
posted August 8, 2005 12:23 PM

With the lastest update and some code to catch the event mine was resolved. My approach is probably overkill, but it worked after adding the following.

=== Example ===
dartFtp.ConnectedChanged += new EventHandler(ConnectionChanged);

private void ConnectionChanged(object sender, System.EventArgs e)
{
 if(!dartFtp.Connected)
 {
  dartFtp.Connection.Close();
  dartFtp.Abort();
 }
}
=== Example End ===
smudger

From: London, United Kingdom
Posts: 2
Member Since: 08/08/05
posted August 9, 2005 3:41 AM

Thanks for that. Just as a matter of interest did you discover the root cause or just develop this belt and braces work around.
dhonda

From: Brea, CA USA
Posts: 8
Member Since: 04/15/05
posted August 9, 2005 11:40 AM

Belt and braces.
Reply | PowerTCP FTP for .NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX