Timers quit working in a service..

G

Guest

Frustrated.. (I have seen other posts regarding this problem with no
resolution..) I am using dotnet 1.1 with latest SP on a Win2KP box (actually
2 boxes), have even run the service on WinXP SP2 box.. I have created a
service to grab data off a receive socket (small packets), place in a queue
(Queue class), and do an insert into SQL. I have 3 timers in my project. One
checks the status of the sql service every 15 seconds, one checks the time
every 2 seconds, and one checks the Queue every 150ms for data, if any write
the data to SQL. The queue timer subroutine and the sql timer have just
QUIT.. I placed break points at the start of the code and they no longer
fire, but the check time timer and other subs are still firing.. I am using
the correct timer type (not the forms timer). I disabled two of the timers
and it never breaks. The code breaks with all the timers running after
several hours, but I show no increase in memory(leak). I transferred the
code to a windows form app with all timers and it NEVER dies, What gives? I
have seen other posts saying more than one timer in a service causes
problems or that they encounter weird thing happen. Any ideas why
breakpoints are dead, multiple timers don't work.. ANy way to figure out
whats going on. Thanks...
BUC
 
G

Guest

I found a workaround but am unsure why it works. There is no source code
anywhere to set .enable to false, and the debugging session says the timers
..enable property = true. SO..I set the .enable to false and then right back
to true and the each timers event's magically started firing again.. Weird
way to make it start working again. Something is buggy as crap with
system.timer in a service. I can easily dup this problem..
BUC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top