Server-based timers working.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • archana

    Server-based timers working.

    Hi all,

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

    Which one of either system.timers.t imer, system.threadin g.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.

  • pappu

    #2
    : Server-based timers working.

    System.Timers.T imer t = new System.Timers.T imer();
    t.Elapsed += new System.Timers.E lapsedEventHand ler(Timer_Elaps ed);
    t.Interval = 2000;
    t.Enabled = true;

    try out this

    Comment

    • archana

      #3
      Re: : Server-based timers working.

      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.T imer t = new System.Timers.T imer();
      t.Elapsed += new System.Timers.E lapsedEventHand ler(Timer_Elaps ed);
      t.Interval = 2000;
      t.Enabled = true;
      >
      try out this

      Comment

      • pappu

        #4
        well ......

        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.

        Comment

        • Dave Sexton

          #5
          Re: Server-based timers working.

          Hi,

          The two most notable differences is that the System.Timers.T imer 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.Threadin g.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"
          Find official documentation, practical know-how, and expert guidance for builders working and troubleshooting in Microsoft products.


          --
          Dave Sexton

          "archana" <trialproduct20 04@yahoo.comwro te in message
          news:1163142376 .613136.45120@e 3g2000cwe.googl egroups.com...
          Hi all,
          >
          can anyone tell me how server based timer in .net works?
          >
          Which one of either system.timers.t imer, system.threadin g.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.
          >

          Comment

          • Adam Clauss

            #6
            Re: : Server-based timers working.

            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" <trialproduct20 04@yahoo.comwro te in message
            news:1163148473 .745791.206610@ f16g2000cwb.goo glegroups.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.T imer();
            > t.Elapsed += new System.Timers.E lapsedEventHand ler(Timer_Elaps ed);
            > t.Interval = 2000;
            > t.Enabled = true;
            >>
            >try out this
            >

            Comment

            • ignacio machin

              #7
              Re: : Server-based timers working.

              HI,

              This could be due another problems, do u have a logging in place?
              capture AppDomain.UnHan dledException 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.T imer t = new System.Timers.T imer();
              t.Elapsed += new System.Timers.E lapsedEventHand ler(Timer_Elaps ed);
              t.Interval = 2000;
              t.Enabled = true;

              try out this
              >
              >

              Comment

              • ignacio machin

                #8
                RE: well ......

                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.
                >
                >

                Comment

                • Laurent Bugnion

                  #9
                  Re: : Server-based timers working.

                  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.T imer. The symptom
                  is, yes, that they just stop working after a few days. We replaced them
                  with System.Threadin g.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

                  Comment

                  • archana

                    #10
                    Re: : Server-based timers working.

                    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.

                    Comment

                    • Adam Clauss

                      #11
                      Re: : Server-based timers working.

                      Give what Laurent suggested a try - use System.Threadin g.Timer a try instead
                      of System.Timers.T imer. 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" <trialproduct20 04@yahoo.comwro te in message
                      news:1163242642 .775723.38480@k 70g2000cwa.goog legroups.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.
                      >

                      Comment

                      Working...