Click here to Skip to main content
15,913,722 members
Home / Discussions / C#
   

C#

 
QuestionArrayList search Pin
kanchoette18-Jan-09 23:55
kanchoette18-Jan-09 23:55 
AnswerRe: ArrayList search Pin
SeMartens18-Jan-09 23:59
SeMartens18-Jan-09 23:59 
GeneralRe: ArrayList search Pin
CodingYoshi19-Jan-09 4:20
CodingYoshi19-Jan-09 4:20 
Questionmdi forms with parent and child interaction Pin
bfis10813718-Jan-09 23:38
bfis10813718-Jan-09 23:38 
AnswerRe: mdi forms with parent and child interaction Pin
harold aptroot18-Jan-09 23:44
harold aptroot18-Jan-09 23:44 
GeneralRe: mdi forms with parent and child interaction Pin
DaveyM6919-Jan-09 1:16
professionalDaveyM6919-Jan-09 1:16 
GeneralRe: mdi forms with parent and child interaction Pin
CodingYoshi19-Jan-09 4:16
CodingYoshi19-Jan-09 4:16 
Questionstrange Http timeout issue Pin
George_George18-Jan-09 23:11
George_George18-Jan-09 23:11 
Hello everyone,

I met with timeout issue. Here is my whole code. I just send Http request to two local LAN servers and see if response could be received in given time, then I treat the server as healthy, or else I will treat them as unhealthy.

The two servers are simple ASP.Net ASMX Web Serviers Web Servers on IIS. The timeout will happen for both servers are PingServers method executing for 4-5 times successfully. It is strange timeout since the server are pretty fast -- I use IE to access the same URL, it takes less than 1 second to return, but in my code, I set timeout to be 4 seconds, it will prints timeout.

Does anyone have any ideas? Any bugs in my 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());
         return;
     }

     Console.WriteLine((String)state + " is healthy");

     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;
 }


thanks in advance,
George
QuestionHow to translate the property item name of the control in the properties window? Pin
mctramp16818-Jan-09 21:02
mctramp16818-Jan-09 21:02 
AnswerRe: How to translate the property item name of the control in the properties window? Pin
Eddy Vluggen18-Jan-09 22:02
professionalEddy Vluggen18-Jan-09 22:02 
GeneralRe: How to translate the property item name of the control in the properties window? Pin
mctramp16819-Jan-09 0:13
mctramp16819-Jan-09 0:13 
AnswerRe: How to translate the property item name of the control in the properties window? Pin
Eddy Vluggen19-Jan-09 1:28
professionalEddy Vluggen19-Jan-09 1:28 
GeneralRe: How to translate the property item name of the control in the properties window? Pin
mctramp16819-Jan-09 15:22
mctramp16819-Jan-09 15:22 
Questionhow to detect windowstate outside form? Pin
ping_jacob18-Jan-09 20:46
ping_jacob18-Jan-09 20:46 
AnswerRe: how to detect windowstate outside form? [modified] Pin
Luc Pattyn18-Jan-09 21:15
sitebuilderLuc Pattyn18-Jan-09 21:15 
GeneralRe: how to detect windowstate outside form? Pin
ping_jacob18-Jan-09 22:46
ping_jacob18-Jan-09 22:46 
AnswerRe: how to detect windowstate outside form? [modified] Pin
Luc Pattyn18-Jan-09 23:05
sitebuilderLuc Pattyn18-Jan-09 23:05 
AnswerRe: how to detect windowstate outside form? Pin
Giorgi Dalakishvili19-Jan-09 0:38
mentorGiorgi Dalakishvili19-Jan-09 0:38 
Questionsystem hang debug Pin
George_George18-Jan-09 19:59
George_George18-Jan-09 19:59 
AnswerRe: system hang debug Pin
N a v a n e e t h18-Jan-09 20:34
N a v a n e e t h18-Jan-09 20:34 
GeneralRe: system hang debug Pin
George_George18-Jan-09 20:50
George_George18-Jan-09 20:50 
GeneralRe: system hang debug Pin
N a v a n e e t h18-Jan-09 20:55
N a v a n e e t h18-Jan-09 20:55 
GeneralRe: system hang debug Pin
George_George19-Jan-09 1:26
George_George19-Jan-09 1:26 
AnswerRe: system hang debug Pin
Luc Pattyn18-Jan-09 21:21
sitebuilderLuc Pattyn18-Jan-09 21:21 
GeneralRe: system hang debug Pin
N a v a n e e t h18-Jan-09 21:26
N a v a n e e t h18-Jan-09 21:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.