|
-
Jul 12th, 2004, 03:50 PM
#1
Thread Starter
Lively Member
Timers in Client Server Application-Help
Hello Everybody,
I have created a console multithreaded client server application where many client connects to the server. I have created a timer in the server which asks the client every 30 seconds whether the client is connected to the server...The client immediately response to the server that it is connected.
However my timer works well when only when one client is connected to the server. My first problem is How should I code so that the timer event works for all the connected clients ??The second problem I am facing is that only when one client is connected to the server the timer event works well.However when the 1st Client disconnects and after sometime 2nd Client connects , the timer events fires twice.... from the server.If the 2nd client disconnects and the 3rd client connects the timer event fires 3 times from the server...
testTimer.Enabled=true;
testTimer.Interval=20000;
testTimer.Elapsed+=new System.Timers.ElapsedEventHandler (testTimer_Elapsed);
private void testTimer_Elapsed(object sender,System.Timers.ElapsedEventArgs e)
{
System.Console.WriteLine("IstheActiveXControlAlive");
timerThd = new Thread(new ThreadStart(timerLoadThread));
timerThd.Start() ;
}
Pls guide as I am stucked on these issue for weeks.
Rahil
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|