I am doing FTP using internetreadfile and I have come upon
a problem. If you disconnect from the network during this
process. The device hangs and the internetreadfile never
times out. Does anyone know how I can set a timeout for
internetreadfile??
Thanks,
Steve
You should be able to control the FTP Send and Recieve timeouts via code
like this:
DWORD dwSendTimeoutMS = (1 * 60 * 1000) // 1 minute
InternetSetOption(NULL, INTERNET_OPTION_DATA_SEND_TIMEOUT, (void
*)&dwSendTimeoutMS, sizeof(dwSendTimeoutMS));
DWORD dwRecvTimeoutMS = (1 * 60 * 1000) // 1 minute
InternetSetOption(NULL, INTERNET_OPTION_DATA_RECEIVE_TIMEOUT, (void
*)&dwRecvTimeoutMS, sizeof(dwRecvTimeoutMS));
Note that the handle specified in InternetSetOption is NULL, meaning that
these timeouts are global for all connections initiated in the instance of
WININET for the process.
--
___________________________________
Jay McLain
Software Development Lead - Pocket IE
Mobile Devices Division
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
"Steven Thurner" <thurn...@yahoo.com> wrote in message
news:070501c314d3$d70638b0$a001...@phx.gbl...