473,480 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 2059
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
4548
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
4432
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
669
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
2790
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
4505
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
6699
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
7280
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
6589
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
6992
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
2996
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
7037
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
6904
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7034
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
5324
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4768
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...
0
4472
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2990
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2976
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1294
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.