Network Sockets
I have a program that needs to run on one machine with a copy of the same program running on another machine as a backup to the main. If the main program goes down for some reason the backup needs to take over and continue running as the main. What type of sockets would work for comunicating between the programs so each is aware of the status of the other through message traffic (such as Backup ok Main ok)
Danatas GerviPosted Oct 28, 2009, 11:27 AM
Ok.
I suggest following solution.
1. Let's forget about sockets. We in WCF age. :-)
2. Main program can host WCF service.
3. BackUp program will be client, connected to this service (binding and behavior may be not hard-coded and easy configured in app.config.
4. Every timer event the BackUp will call the Main program method, that will check the situation, and will answer to client ("I am Ok" or "Error, your work").
5. In case of all Main program failure – Client will get exception of WCF "service is disconnected", so, it also may be used as trigger to start work.
That's all.
GordonPosted Oct 28, 2009, 9:59 AM
Danatas GerviPosted Oct 28, 2009, 4:49 AM
This is not linked to sockets. For sending a message you can use any type of socket.
One question-
What does "main program goes down" mean?
What happens exactly?