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

CHttpFile read hangup

170 views
Skip to first unread message

Alex Nechiporenko

unread,
Mar 10, 2004, 1:46:06 AM3/10/04
to
Good Day!

Does anybody have any experience using the CInternetSession::SetOption() to
set the timeout for CHttpFile::Read()? Or is there any other method to do
the job?

I have tried the CInternetSession::SetOption() as follow (it did not work):

CInternetSession session("Http");
session.SetOption( INTERNET_OPTION_DATA_RECEIVE_TIMEOUT, 10000);
CHttpConnection pServer = session.GetHttpConnection( ServerName, nPort);

CHttpFile File = pServer.OpenRequest(CHttpConnection::HTTP_VERB_POST, file);

try
{
File.SendRequest(sHeader,(LPVOID)sBody, sBody.GetLength());
}
catch(CInternetException *e )
{
..............
e->Delete();
return FALSE;
}

UINT nRead;
DWORD dwRet;
File.QueryInfoStatusCode(dwRet);

if(dwRet == HTTP_STATUS_OK)
{
try
{
while(nRead=pFile.Read(szBuf, 100)){
............
}
}
catch(CInternetException *e)
{
............
e->Delete();
}

The problem is this:
If the Web Server returned some data, then crashed or just sat idle forever
without returning anything . It should time out after 10 seconds as I have
set in the CInternetSession::SetOption(), but it failed to do that. It
also sat idle until it finally received an Internet Exception at
approximately 15 minutes later.

TECH

unread,
Mar 10, 2004, 2:17:43 AM3/10/04
to

TECH

unread,
Mar 10, 2004, 1:16:14 PM3/10/04
to
Where did you find that info? I think that constant it is no longer
supported starting from IE 5.0

TECH
http://www.tversoft.com


"Alex Nechiporenko" <anon...@discussions.microsoft.com> wrote in message
news:19EEF1FA-E782-4B18...@microsoft.com...
> But they say that this bug was fixed from IE 5.01. And I have IE 6.0
installed.


TECH

unread,
Mar 10, 2004, 4:58:07 PM3/10/04
to
Yes, connect timeout is fixed but receive timeout is removed.
INTERNET_OPTION_RECEIVE_TIMEOUT no longer works in Internet Explorer 5.0.
For more information, see the following article in the Microsoft Knowledge
Base: Q224318
Note that Q224318 is applicable to IE 5, 5.5 etc.

TECH
http://www.tversoft.com

"Alex Nechiporenko" <anon...@discussions.microsoft.com> wrote in message

news:05DD13FB-B92F-4D85...@microsoft.com...
> From
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q176/4/20.asp&NoWebContent=1 :
>
> "The latest version of the Wininet.dll file that shipped with Internet
Explorer 5.01 (available for download) fixes all timeout problems for HTTP
APIs only. FTP timeouts still cannot be changed."


0 new messages