Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

internetreadfile

0 views
Skip to first unread message

Steven Thurner

unread,
May 7, 2003, 4:04:17 PM5/7/03
to
Hi,

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

Jay McLain [MSFT]

unread,
May 13, 2003, 3:05:37 PM5/13/03
to
On Pocket PC 2002 and Smartphone 2002 by default the data Send and Recieve
timeouts are 5 minutes.

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...

0 new messages