+ 1
How to create a watchdog in C#
I have 2 applications which needs to be running. One application cannot function without the other. If one application is not running or died. The other should give an error instantly. What is the best way to do this in C# ? The 2 application will run on different PC's but in the same network
4 Answers
+ 5
What are the 2 applications? Web? Desktop? Mobile? Web Service?
Do you mean both application will call each other? That would be pretty strange as it somewhat resembles circular dependency. Anyway, what's the protocol used?
+ 2
Thank you.
The applications are windows desktop application.
The protocol used is TCP/IP
It is a sort of client/server construction. Both application do have a UI each that shows the relevant data to their user.
The client sends the data to the server.
The server tells the client the data has been saved.
If the server dies, the client is not able to store its data and should stop collecting data and show a error at its UI.
If a client dies, the server should show in the UI that this client is not present anymore.
My first thought was to make 4 timers and 4 event.
One that fires a "I am alive" event
and another "I received a I am alive" event
I have seen solutions in google, that use window process to check whether the process is alive. That look like a local solution. Where client and server are on the same PC.
I have to look into the terms SOA and WCF. I am not sure I want to make a service, but it might be a good idea.
Thank you