Home All Groups Group Topic Archive Search About

System.Timers.Timer elapsing while disabled?

Author
22 Nov 2004 8:21 PM
Matthew Creegan
I have a component with 4 timers.  Each has a separate elapsed handler.  Each
also has an associated delegate invoked (from the elapsed handler).  And each
delegate has its own callback.

In each handler I do the following:
Stop the associated timer
Construct an AsyncCallback
BeginInvoke a delegate (with the callback param)

In the delegate target, I call web methods and process the results.

In the callback, I do the following:
Call EndInvoke
Start the associated timer

I'm trying to get to the bottom of what seems to be a memory issue.  As I've
been working on this issue, I've noticed that when the machine get's really
low on memory, the elapsed handlers are managing to fire several times before
the delegate calls back.  How can this happen?

I've read about how to use SignalTime from the ElapsedEventArgs, but this
only tells me when time the elapsed was raised.  I'm stopping the timer
within its own elapsed handler (actually in the first LOC).  So, what am I
missing here?

Thanks.

Matt

AddThis Social Bookmark Button