Thank you for answering my question.
Yes, I have verified and tested all of those and more. :-) I have been
looking into this problem for a couple of weeks now and have found other
developers with the same problem in old news groups. Some of them only
experienced the problem on their local machines and among them some could
identify [EMAIL PROTECTED] or other distributed computing clients as the cause of
the problem, others had to format and reinstall OS and everything else...
As for myself, I have tried my application on my own computer (Win XP
Pro), on our test server (Win 2k Server) and one of our production servers
(Win 2k Server) with the same result: WebException: "The operation has
timed-out." If I run my app over and over on the same 50 URLs, the URLs
working and the ones resulting in time-outs are different ones from time
to time.
I think it is strange that Microsoft has no information on the subject
since this strange behaviour has been reported by several users since
early 2002.
/joakim
On Thu, 15 Jan 2004 18:31:54 -0500, Stephen Johnston
<[EMAIL PROTECTED]> wrote:
>Just a couple of 'is the printer plugged in type of questions':
>
>1. Have you tested this with a definite good URL?
>2. Have you verified that you are not putting a bad link into your
function?
>3. Have you verified that the domains are good. Bad domains will 'time
out'
>I believe. Whereas good domains with bad file names will 404.
>
>-Stephen Johnston
>
>At 05:46 AM 1/15/2004, you wrote:
>>Hi all.
>>I am trying to build an application that checks for broken URLs
>>using the System.Net.WebRequest.Create, but I constantly get this
>>WebException: "The operation has timed-out." Sometimes on 10 out of
>>50 URLs, sometimes (more often) on 40 out of 50 URLs. I have tried,
>>among other things, setting
>>ServicePointManager.DefaultConnectionLimit to 200, increasing the
>>TimeOut and setting Keep-Alive to false, but nothing seems to solve
>>the problem.
>>
>>This is the method I am using in an iteration for about 50 links:
>>
>>protected string TestLink(string link)
>>{
>>try
>>{
>>
>>ServicePointManager.DefaultConnectionLimit = 200;
>>objRequest = (HttpWebRequest)
>>System.Net.WebRequest.Create(link);
>>
>>try
>>{
>>objResponse = (HttpWebResponse) objRequest.GetResponse();
>>}
>>catch(WebException exc)
>>{
>>WebExceptionStatus exceptionStatus = exc.Status;
>>return String.Format("{2}\n WebException, Msg: {0}<br />Status: {1
>><br />", exc.Message, exceptionStatus.ToString(), link);
>>}
>>finally
>>{
>>try
>>{
>>objResponse.Close();
>>}
>>catch (Exception ex)
>>{}
>>}
>>}
>>catch(UriFormatException exc)
>>{
>>return String.Format("{1}\n UriFormatException: {0}", exc.Message,
>>link);
>>}
>>catch(NotSupportedException exc)
>>{
>>return String.Format("{1}\n NotSupportedException: {0}",
>>exc.Message, link);
>>}
>>catch(Exception exc)
>>{
>>return String.Format("{1}\n Exception: {0}", exc.Message, link);
>>}
>>
>>return String.Format("{0}\n Success: {1} ({2})", link,
>>objResponse.StatusCode, objResponse.StatusDescription);
>>}
>>
>>Can someone tell me where I am going wrong?
>>
>>I am calling the method from an exe-file on Windows 2000 Server and
>>Windows XP Professional (same result).
>>
>>Thanks.
>>
>>/joakim
>>
>>===================================
>>This list is hosted by DevelopMentor� http://www.develop.com
>>Some .NET courses you may be interested in:
>>
>>NEW! Guerrilla ASP.NET, 26 Jan 2004, in Los Angeles
>>http://www.develop.com/courses/gaspdotnetls
>>
>>View archives and manage your subscription(s) at
http://discuss.develop.com
>
>===================================
>This list is hosted by DevelopMentor� http://www.develop.com
>Some .NET courses you may be interested in:
>
>NEW! Guerrilla ASP.NET, 26 Jan 2004, in Los Angeles
>http://www.develop.com/courses/gaspdotnetls
>
>View archives and manage your subscription(s) at
http://discuss.develop.com
===================================
This list is hosted by DevelopMentor� http://www.develop.com
Some .NET courses you may be interested in:
NEW! Guerrilla ASP.NET, 26 Jan 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls
View archives and manage your subscription(s) at http://discuss.develop.com