Re: system hang debug
Thanks Pavel!
1.
Is your link related to my question? :-)
2.
Here is my code to reproduce it (the following code segment causes my
application hang). You can change the localserver to google.com or ask.com to
reproduce easy -- after a couple of times of success, other operations are
all timeout. Currently, the fix should be call close method n response.
My question is not about .Net (my apologies if it makes people confused),
but using Windbg to debug leak issues and find the internal cause. I think it
is either .Net bug which does not recycle the connection timely, or system
has some limitations about open connection (I did not find such document
after quite some time search)? I am so confused. Could you reproduce my
problem at your side? Any insights?
[Code]
static void PingServers(Object state)
{
HttpWebRequest request =
(HttpWebRequest)WebRequest.Create((String)state);
request.Timeout = 4 * 1000;
HttpWebResponse response = null;
try
{
response = (HttpWebResponse)request.GetResponse();
}
catch (WebException ex)
{
Console.WriteLine((String)state + " " + ex.ToString());
// response.Close();
return;
}
Console.WriteLine((String)state + " is healthy");
// response.Close();
return;
}
static Timer[] monitorTimers = new Timer[2];
static void Main(string[] args)
{
monitorTimers[0] = new Timer(PingServers,
"http://localserver1/test/test.ashx", 0, 10 * 1000);
monitorTimers[1] = new Timer(PingServers,
"http://localserver2/test/test.ashx", 0, 10 * 1000);
Console.ReadLine();
return;
}
[/Code]
regards,
George