I first posted this question on MSDN forums and was re-directed here.
With Windows Services, you have Start, Stop, Shutdown events you can use to trigger various behavior within the service.
In my case, I have a Web Service that has a pub sub connection over TCP.
Is there a way to get an event related to an App Pool Recycle where I could disconnect from the Sub right at the start... process any pubs that I need to process before releasing all resources prior to the App Pool termination (presumably a new instance has already spun up).
In IIS 8, there is a way to call a public method in the source code as the app pool initializes. If there were such a method exposed when an app pool recycle starts, this would do the trick for me.
Thanks!!