I have Silverlight application which connects to a WCF service.
If i open the open connection at the start of the application and then say give it 10 minutes or so before the client comes to call a method it will time out.
I understand that it is easy to change the timeout time in the web.config.
However what I’m looking for it for the WCF service to remain active to say 5 minutes after the soap client has been closed.
I though about maybe running a background thread in Silverlight which calls a WCF method which doesn’t do anything but this feels rather hacky.
Is there more of a professional way of doing this?
Thanks
You can change InstanceContextMode to signleton and start the service in the service constructor. Using signleton mode means that your session never expires.
Another solution is changing the InstanceContextMode to PerSession and set the InactivityTimeout to something like 1 hour.
UPDATE(After reading your comment): You can also set the inactivityTimeout=”infinite”.