PDA

View Full Version : MFC FTP Wininet API read problem


mukul
February 29th, 2008, 08:20 AM
I am having a problem in my FTP client designed using MFC wininet API. I am using Visual C++ 6.0.

I create a session variable through which I open a FTP connection and then I read any file on the FTP server. After reading few characters I try to close the file(or delete connection pointer or session variable).

Problem:-- My application hangs if I try to close the file as soon as I am done with reading the file. If I wait for sometime after reading the file and then closes the file the application does not hang. Adding a delay after reading the file serves the purpose but it is not a very elegant method and secondly the delay I think will be dependent on Server's speed. Can you suggest me how to proceed !!!