State signalling from windows services
-
Happy New Year ! to all. :) Just wondering if someone would give me a bit of guidance on this. I need to signal various points of code execution from a windows service to a monitoring application on the same machine. This is apart from those handled by "Service controller class". I have had a look at tcp sockets, .net remoting and named pipes, but that all seems like overkill. As i am simply looking for a boolean flag, no messages or data transfer as such. Has anyone found a simple way of doing this,i know i must be missing something ? Thanks in advance.
-
Happy New Year ! to all. :) Just wondering if someone would give me a bit of guidance on this. I need to signal various points of code execution from a windows service to a monitoring application on the same machine. This is apart from those handled by "Service controller class". I have had a look at tcp sockets, .net remoting and named pipes, but that all seems like overkill. As i am simply looking for a boolean flag, no messages or data transfer as such. Has anyone found a simple way of doing this,i know i must be missing something ? Thanks in advance.
IPC generally isn't a simple thing. If you want to signal state from one process to another then you have to send some sort of message but it doesn't have to be a big one. Two simpler options than the ones you listed are shared file IO (see the System.IO[^] namespace) and MSMQ (see the MessageQueue[^] class). If you want quick and easy, I suggest you look into the MSMQ option; it boils down to just a few lines of code for both sending and receiving messages. :badger:
-
IPC generally isn't a simple thing. If you want to signal state from one process to another then you have to send some sort of message but it doesn't have to be a big one. Two simpler options than the ones you listed are shared file IO (see the System.IO[^] namespace) and MSMQ (see the MessageQueue[^] class). If you want quick and easy, I suggest you look into the MSMQ option; it boils down to just a few lines of code for both sending and receiving messages. :badger:
Thanks for that, i will investigate the message queue alternative i think. I had thought about using an XML file but it seems like that could introduce possible problems. It is reliability i am after.