-1

Possible Duplicate:
What is the simplest method of inter-process communication between 2 C# processes?

I need to develop a windows application in C# where two instances of the application will run. One will be operational and another will be on standby. If for any reason first instance will hang or stop working, the second instance should start operation.

Community
  • 1
  • 1
Krish
  • 17
  • 2

2 Answers2

2

Use a database. The first instance stores everything in the database (and uses transactions if possible, to make sure the data is always in a consistent state). The second instance can then wake up and read the latest state from the database.

zmbq
  • 38,013
  • 14
  • 101
  • 171
1

However you handle the data is one thing.

A more common way to do what you're trying is having a watchdog process. He is not a second instance of the same process. Instead, he listens to a heartbeat, or something else on the first process. If he decides that the first process is dead, he then can kill it / start a new instance, etc.

Jonathon Reinhart
  • 132,704
  • 33
  • 254
  • 328