473,399 Members | 4,177 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Server-based timers working.

Hi all,

can anyone tell me how server based timer in .net works?

Which one of either system.timers.timer, system.threading.timer is
better for use in windows service.

How worker thread call elapsed event. Will it depend on any of system
factors?

If anyone can shed some light on it then it will really benefical for
me.

thanks in advance.

Nov 10 '06 #1
10 2055
System.Timers.Timer t = new System.Timers.Timer();
t.Elapsed += new System.Timers.ElapsedEventHandler(Timer_Elapsed);
t.Interval = 2000;
t.Enabled = true;

try out this

Nov 10 '06 #2
Hi,

Thanks for your reply.

I am doing same thing. It is working properly for say 7-8 days and
suddently timer_slaped is not getting raised.

can you tell me reason behind this.

thanks in advance.

pappu wrote:
System.Timers.Timer t = new System.Timers.Timer();
t.Elapsed += new System.Timers.ElapsedEventHandler(Timer_Elapsed);
t.Interval = 2000;
t.Enabled = true;

try out this
Nov 10 '06 #3
Sorry to say but Well buzy right now ..........

if u dun mind can me one ans

Hello friends can any body tell me how to redact image in web
application. thanks, Sachin.

Nov 10 '06 #4
Hi,

The two most notable differences is that the System.Timers.Timer class is a
Component-based timer that can be dropped into the component tray of a
designer, and it's inherently thread-safe. There are other differences as
well, but I tend to use the System.Threading.Timer in all circumstances where
designer support isn't required, event though thread-safety must be explicitly
enforced.

"Comparing the Timer Classes in the .NET Framework Class Library"
http://msdn.microsoft.com/msdnmag/is...T/default.aspx

--
Dave Sexton

"archana" <tr**************@yahoo.comwrote in message
news:11*********************@e3g2000cwe.googlegrou ps.com...
Hi all,

can anyone tell me how server based timer in .net works?

Which one of either system.timers.timer, system.threading.timer is
better for use in windows service.

How worker thread call elapsed event. Will it depend on any of system
factors?

If anyone can shed some light on it then it will really benefical for
me.

thanks in advance.

Nov 10 '06 #5
What version of .NET are you using? We had a situation where an application
has a number of timers, and under .NET 1.1 they would periodically just stop
firing. After we upgraded to .NET 2.0 the problem resolved itself. I'm
assuming this was some bug in the timers implementation.

--
Adam Clauss

"archana" <tr**************@yahoo.comwrote in message
news:11**********************@f16g2000cwb.googlegr oups.com...
Hi,

Thanks for your reply.

I am doing same thing. It is working properly for say 7-8 days and
suddently timer_slaped is not getting raised.

can you tell me reason behind this.

thanks in advance.

pappu wrote:
>System.Timers.Timer t = new System.Timers.Timer();
t.Elapsed += new System.Timers.ElapsedEventHandler(Timer_Elapsed);
t.Interval = 2000;
t.Enabled = true;

try out this

Nov 10 '06 #6
HI,

This could be due another problems, do u have a logging in place?
capture AppDomain.UnHandledException and log any possible exceptions

"archana" wrote:
Hi,

Thanks for your reply.

I am doing same thing. It is working properly for say 7-8 days and
suddently timer_slaped is not getting raised.

can you tell me reason behind this.

thanks in advance.

pappu wrote:
System.Timers.Timer t = new System.Timers.Timer();
t.Elapsed += new System.Timers.ElapsedEventHandler(Timer_Elapsed);
t.Interval = 2000;
t.Enabled = true;

try out this

Nov 10 '06 #7
humm?

"pappu" wrote:
Sorry to say but Well buzy right now ..........

if u dun mind can me one ans

Hello friends can any body tell me how to redact image in web
application. thanks, Sachin.

Nov 10 '06 #8
Hi,

archana wrote:
Hi,

Thanks for your reply.

I am doing same thing. It is working properly for say 7-8 days and
suddently timer_slaped is not getting raised.

can you tell me reason behind this.

thanks in advance.
In .NET 1.1, there is a known bug with System.Timers.Timer. The symptom
is, yes, that they just stop working after a few days. We replaced them
with System.Threading.Timer and it works fine.

I don't know if the bug is corrected in 2.0.

HTH
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch
Nov 10 '06 #9
Hi,

thanks a lot for lots of replies.

I am using .net framework 1.1 . And in that i am facing this problem.

I can't switch to framework 2.0 right now. so is there any alternative
avaialble in 1.1 framework to fix this problem.

any help will be truely appreciated.

thanks in advance.

Nov 11 '06 #10
Give what Laurent suggested a try - use System.Threading.Timer a try instead
of System.Timers.Timer. Other than that, it's just a bug in the framework
and there probably isn't much you can do until you can update to 2.0.

--
Adam Clauss

"archana" <tr**************@yahoo.comwrote in message
news:11*********************@k70g2000cwa.googlegro ups.com...
Hi,

thanks a lot for lots of replies.

I am using .net framework 1.1 . And in that i am facing this problem.

I can't switch to framework 2.0 right now. so is there any alternative
avaialble in 1.1 framework to fix this problem.

any help will be truely appreciated.

thanks in advance.

Nov 14 '06 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Phil | last post by:
I am using a Pascal like language (Wealth-Lab) on W2K and call this server: class HelloWorld: _reg_clsid_ = "{4E797C6A-5969-402F-8101-9C95453CF8F6}" _reg_desc_ = "Python Test COM Server"...
6
by: Nathan Sokalski | last post by:
I want to set up SQL Server on Windows XP Pro so that I can use the database capabilities of ASP and IIS. I am probably using some incorrect settings, but I am not sure what they are. Here is what...
9
by: Grim Reaper | last post by:
My work let me put SQL Server 7.0 Enterprise Edition on my laptop. I have never setup a server from the beginning, so I am a little new at creating server groups. Alright, I am trying to create...
0
by: Chris Halcrow | last post by:
Hi I've spent ALL DAY trying to re-install SQL Server 2000 on Windows XP. I continually get the error 'cannot configure server' just at the end of the installation. I've tried the following: ...
0
by: Zorba.GR | last post by:
IBM DB2 Connect Enterprise Edition v8.2, other IBM DB2 (32 bit, 64 bit) (MULTiOS, Windows, Linux, Solaris), IBM iSoft Commerce Suite Server Enterprise v3.2.01, IBM Tivoli Storage Resource Manager...
4
by: rs | last post by:
how I the client tell the server that the socket is closed? or this there an even that informs the server that the clients socket is close? Oh, I am using vb.net 2003 Thanks
4
by: coosa | last post by:
Hi, I was installing SQL Server on my machine and during installation my PC freezed. It happens frequently on my machine. So i tried after restarting to install it again and since then i always...
1
by: Peter | last post by:
I've purchased VS.NET 2005 Standard and have tried to install SQL Server 2005 Express, but get the following error in the error log. Please could someone help me.... Microsoft SQL Server 2005...
14
by: Marcus | last post by:
I have a function that simply returns TRUE if it can connect to a particular Sql Server 2005 express, or FALSE if it cannot. I am getting some strange error codes returned when the computer that...
14
by: Developer | last post by:
Hello All, i have recently installed VS2005 and was trying to install SQL sever 2000. I have Win XP' SP2. But when I tried installing, it only installed client tools and not the database. Can...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.