I am building a sharepoint 2010 application (server APIs, c#) that sends notification messages via TCP from sharepoint server to server X whenever a file changes in a sharepoint library. I have my code in ItemUpdated() method of my class inherited from SPItemEvenReceiver.
Apart from notification messages I need to send keep alive messages to server X every T seconds. These keep alives have to be sent after the application is installed on the sharepoint server and whenever it's up and running. I do it by listening to FeatureActivated event of SPFeatureReceiver. So when the feature is activated on a site collection, my "init" code runs and starts sending keep alive messages.
When either of the following events happen:
1) IIS application pool gets recycled every day at 1:50 am (default setting), or 2) server is powered down, then powered up
my "init" code is not executed (because there is no "Feature activate" event), and keep alives are not sent.
Is there a way of receiving of some sort of event in my application that would fire in both cases, so I could run my "init" code?
Thanks