c# - How to Recycle a Self-Hosted WCF Service -


i'm hosting wcf service in azure woker role this.

i'd able "recycle" wcf service host on regular interval. problem is, assume service running it's own app domain, , have no way poll events, nor can share common data between worker role , wcf service.

for reference, here's minimum code host:

public override void run() {     using(var host = new servicehost(typeof(myservice))     {         // configure host here...          host.open          while(true)         {             sleep(1000);         }     } } 

i'd "restart" host somehow every 24 hours, i'm not sure how/what hook accomplish that.

the wcf service running in-proc worker role right (ie. running in waworkerhost.exe)? in case can either call roleenvironment.requestrecycle, or let run() method exit. either way cause waworkerhost.exe gracefully shut down, , azure guest agent automatically restart everything.


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -