.net - System.Windows.Forms.Timer is not Working in my WCF service -
i have created restful wcf service.whenever client calling service method have started timer interval below
var timer = new timer(); timer.interval = convert.toint32(attempt); timer.tick += new eventhandler(timer_tick); var tempattempt = new tempattempt { alertinformationid = currentalertid, attempt = getattemptid(attempt), status = false, timerid = "timer" + currentalertid.tostring() }; if (createnewattempt(tempattempt)) { timer.tag = tempattempt.timerid; timer.enabled = true; timer.start(); } private void timer_tick(object sender, eventargs e) { //blah blah timer t = (timer)sender; }
after starting timer tick not happened after particular interval.how can resolve this?
my service
[webinvoke(method = "post", requestformat = webmessageformat.json, bodystyle = webmessagebodystyle.bare, responseformat = webmessageformat.json, uritemplate = "/pushnotification")] [operationcontract] void pushnotification(mailinformation mailinformations);
system.windows.forms.timer wrong class service.
try system.threading.timer instead.
Comments
Post a Comment