This is a migrated thread and some comments may be shown as answers.

Timer request

3 Answers 158 Views
Fiddler Classic
This is a migrated thread and some comments may be shown as answers.
Xu
Top achievements
Rank 1
Xu asked on 14 Sep 2014, 05:49 AM
Eric:

I tried Timer request following this topic: https://groups.google.com/forum/?fromgroups#!searchin/httpfiddler/reissue/httpfiddler/8r9Hop7LMXg/0GROyv2HXWwJ.
Everything is ok at first, it runs as expecting few days. Until this morning. The Timer started, but does not raise the tick!
What is mysterious is if I put a MessageBox following the oTimer.Start() and keep the MessageBox on, it runs quite normal. But once I click the OK button to turn off the MessageBox, the oTimer stop raising tick again.
The code looks like as following: 

static var oTimer: System.Windows.Forms.Timer;
static function TimerStart(){
   
oTimer = new System.Windows.Forms.Timer();
   oTimer.add_Tick( OnTimer );
   oTimer.Interval = 3000;
   oTimer.Start();
   MessageBox.Show(
'Timer Started: ' + oTimer.Interval.toString()  );
}

What the problem is it? What happened?
thx a lot!

3 Answers, 1 is accepted

Sort by
0
Eric Lawrence
Telerik team
answered on 15 Sep 2014, 03:08 PM
Hi, Xu--

This seems like it should work just fine, but your description makes it sound like the timer is getting garbage collected. What code is in the Tick event handler?

Are you doing anything that would cause the script file to reload?


Regards,
Eric Lawrence
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Xu
Top achievements
Rank 1
answered on 15 Sep 2014, 11:19 PM
The Tick event in some way is complex, I can only descript it in few words is: if a specific object is exist, it tries to pop out an Url from a stack, then request the url. When the stack is empty, it raises to refill the stack. If the refilling end successful, pop and request an url again. Otherwise, end the all process.

I guess the problem should not be inside the Tick event, because I put a MessageBox at the beginning of the tick event, but it were not triggered.

And I can sure the script is not reloaded.
0
Eric Lawrence
Telerik team
answered on 16 Sep 2014, 03:53 PM
Where exactly in your script file did you put this code? Can you share your entire script with me?


Regards,
Eric Lawrence
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Fiddler Classic
Asked by
Xu
Top achievements
Rank 1
Answers by
Eric Lawrence
Telerik team
Xu
Top achievements
Rank 1
Share this question
or