I'm using the function CInternetSession::OpenURL in a "try" to open a webpage (a servelet which returns XML). The servelet take a little while to respond sometimes (around 13-15 seconds in a web browser).

When it's slow like this, the code catches a CInternetException. Is there a way to see what the time out is? Does it sound like that could be the problem? The servelet responds in a timely fashion most of the time, so the error is difficult to replicate on demand to debug and see what's going on.

I'm open to suggestions of other stuff to look at as well.

I thought I hit the jackpot when I saw this thread title in the results while googling this problem today.

Anyone know how to see/set the timeout duration?


Edit:
I think I may be on to something...may need to use CInternetSession :: SetOption to change INTERNET_OPTION_CONNECT_TIMEOUT, INTERNET_OPTION_CONNECT_RETRIES, and INTERNET_OPTION_CONNECT_TIMEOUT.

I'm having a rough time finding decent documentation on SetOption and see a lot of reports that it doesn't work sometimes. I'll give it a shot.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.