I use. NET to do a timer timer, timed to get text messages and give replies, but probably after more than 10 hours, timer timer will automatically stop, and then send text messages can not receive a reply, need to re-run the timer in the server can, ask you!
I am in the. NET Framework, there is a Global.asax global application file, post code:
public class Global:System.Web.HttpApplication
{
Double Itimerinterval;
System.Timers.Timer Timer = new System.Timers.Timer ();
Smsrun Smsrun = new Smsrun ();
Object Objlock = new Object ();
protected void Application_Start (object sender, EventArgs e)
{
Code to run when the application starts
Code to run when a new session is started
Setaccount ();
Timer. Start ();//Timer starts
}
protected void Application_End (object sender, EventArgs e)
{
Timer. Stop ();
}
private void Setaccount ()
{
Double. TryParse (configurationmanager.appsettings["TimerInterval"], out itimerinterval);
Timer. Interval = Itimerinterval;
Timer. Elapsed + = new System.Timers.ElapsedEventHandler (getMessage);
GetMessage is a method (slightly)
}
The questioner adopts:
After your supplement, I see it. Because your application is recycled after a specific idle time, the corresponding W3WP worker process is not functioning anymore. You can view the properties of the IIS application pool switch to the Performance tab idle timeout default time is 20 minutes That is, if your site does not have any requests within 20 minutes, it will cause recycling.
-----------------------------------------------------------
:
WebService Timer timer in C # automatically stops running after a period of time