|
-
July 18th, 1999, 11:19 PM
#1
WinInet Blocking Calls
I am using CInternetSession, CFtpConnection and CInternetFile to download files. When the user cancels, I call CInternetFile::Close()from a seperate thread. This does not stop the blocking call to CInternetFile::Read(). It hangs until the server sends a response back. If my code has hasn't gotten to the Read() yet CInternetSession::Close() and CFtpConnection::Close() work. They kill the blocking call in the worker thread, but I can't get the HINTERNETHANDLE to close once in the Read(). I even tried doing things without MFC and using the API functions FtpOpenFile()and InternetReadFile(). Calling InternetCloseHandle() didn't work. It still hangs on slow servers. The documentation for FtpOpenFile() states "If InternetCloseHandle closes the handle before all the data has been transferred, the transfer is terminated." Does anybody have an example of getting this to work. Getting The Read() to terminate immediately on user cancellation without having to wait for all of the retries and timeouts? Preferably using MFC. Any ideas?
Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|