Login  
Search All Forums
Dart Home | PowerTCP FTP for ActiveX | Custom Development Reply | PowerTCP FTP for ActiveX Topics | Forums   
AuthorForum: PowerTCP FTP for ActiveX
Topic: Non blocking Retrieve problem
evanw
evanw@videobankdigital.com

From: Northvale, NJ USA
Posts: 7
Member Since: 06/24/02
posted June 24, 2002 12:52 PM

I'm using the latest updated version of the FTP and some funny problems have appeared. The app is a multi-threaded service and when the retrieve command is issued in non-blocking mode , nothing happens. In blocking mode the cpu usage is near 100% which is unacceptable. I even tried altering thread priority to non avail. Following is a an code fragment

pFtp->TimeOut=0;
pFtp->Type = DartFtp::ftpImage;
pFtp->Directory = bsSourcePath.m_str;
pFtp->Retrieve(bsFile.m_str,(VARIANT * ) &ovLocalFile,lMarker );

The call throws no exception and works perfectly (save the cpu utilization) in blocking mode. Any advice would be great since we cannot have this app take control of the entire servers resources.

E
K M Drake



From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted June 25, 2002 9:00 AM

Hi,
The control will relent when other processes require cpu cycles.
As far as non-blocking usage, it looks like you are programming in a blocking fashion, but setting Timeout to 0. When using the control asynchronously, you must rely on events before making method calls. For example, in this case, the Retrieve should not be made until the Progress event has fired with a FtpCmd of FtpChangeDirectory (4), and a Status of FtpOk (0). Otherwise, the control could send commands before the server has responded to previous ones.
-ken
evanw
evanw@videobankdigital.com

From: Northvale, NJ USA
Posts: 7
Member Since: 06/24/02
posted June 25, 2002 9:27 AM

Thanks tons !!! Can I start my session synchronosly (ie logon and change directory ) then set the timeout to 0 for async processing of the file transfer events?

Regards,
E
K M Drake



From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted June 25, 2002 9:54 AM

Hi,
Sure, you can do that if you want, just make sure to set it back and forth. It may be easier to just program the whole thing asynchronously.
-ken
Reply | PowerTCP FTP for ActiveX Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX