开发者

WCF Service Applcation remaining idle until hit manually .svc file

I create a WCF Service Application that runs in IIS 7.0 . In its initialization I start an endless loop ( while(true) ) , but after a period of time ,where I didn't call a method from his svc file, the wcf pass in an idle mode, and it doesn't react in the process the loop has to do. It is like it stops working. And then if i call a method to his 开发者_JAVA百科svc file then starts working again. Is there a solution to avoid the idle mode so it can continue to keep the procedure in the loop alive?


WCF services are designed to "wake up" when requests are made.

If what you want is something like continuous polling, you may want to consider creating a Windows Service instead.

If you're looking for a WCF service that maintains state, you'll have to implement that yourself. One way is to deploy a Workflow Service (using WF 4) with persistence, such as SqlWorkflowInstanceStore. It exposes its interface using WCF. The service will be idle between calls, but instances will remember state.


WCF is meant to be consumed and to fire events, not to host long-running processes. You really want WF (workflow foundation) or BizTalk to host some long-running events. WCF events are typically short lived. You can create a XAMLX which combines the two concepts.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜